SitePoint Sponsor

User Tag List

Results 1 to 5 of 5

Thread: Diving into ROR

  1. #1
    SitePoint Evangelist j0n's Avatar
    Join Date
    Apr 2003
    Location
    uk
    Posts
    545
    Mentioned
    0 Post(s)
    Tagged
    0 Thread(s)

    Diving into ROR

    I have never been much of a programmer. I've tried to get into programming in one form or another numerous times over the past few years but i normally give up after a few hours. Will this time be any different? -- I have no idea. I only know that i'm going to at least try again.

    So, my question. (i actually have a few)

    Can someone point me in the direction of some really good ROR resources? I have all the generic ones that google threw up which i'm slowly reading though.

    Are there any active, dedicated ror forums that are worth signing up to?

    If there is anything i should look out for, anything i should learn, anything.. anything. Just anything. Any information is very much appreciated.

    Thanks!
    Jon

  2. #2
    SitePoint Evangelist j0n's Avatar
    Join Date
    Apr 2003
    Location
    uk
    Posts
    545
    Mentioned
    0 Post(s)
    Tagged
    0 Thread(s)
    OK, question. (i could have started a new thread but i didn't see much point)

    I'm trying to start a new project and connect to the database so i can start messing about and testing stuff. I've been following the steps outlined on the ror wiki (http://wiki.rubyonrails.com/rails/pages/Tutorial)

    I have a project called "todolist" and am trying to connect to the database.

    This is what it tells me to do.



    And this is the error message i'm getting.



    I've opened up database.yml but i have no idea what i'm meant to be doing. Where do i get the information from to enter in the database.yml file? (if that is what i'm actually meant to do).

  3. #3
    Avid Logophile silver trophy
    ParkinT's Avatar
    Join Date
    May 2006
    Location
    Central Florida
    Posts
    2,345
    Mentioned
    192 Post(s)
    Tagged
    5 Thread(s)

    RoR requires SQL knowledge

    j0n,
    Unfortunately, you also need to understand a little about SQL (MySQL or sqlite) to use Ruby on Rails.
    The database.yml file is where you define the database 'connectivity'. It is assuming you have created an empty database. The most common approach is to use the mysql command line (this depends upon your operating system environment). There is also a GUI tool provided at mysql.com for managing databases. PM me and I will be glad to help you as much as possible.

    Secondly, I strongly recommend you find and join a local Ruby users group. Although I am an old-time programmer (with experience in a dozen different languages), I have gained immense benefit in learning Ruby [on Rails] from my active participation in a local Ruby users' group.

    Lastly, there is a free online RoR training course in which I have been participating. So far it appears to be very thorough and quite basic. I think there is still an opportunity to enroll, even though it is underway: http://www.traineronrails.com/moodle/
    Last edited by ParkinT; May 1, 2008 at 16:52.
    Don't be yourself. Be someone a little nicer. -Mignon McLaughlin, journalist and author (1913-1983)


    Git is for EVERYONE
    Literally, the best app for readers.
    Make Your P@ssw0rd Secure
    Leveraging SubDomains

  4. #4
    SitePoint Evangelist j0n's Avatar
    Join Date
    Apr 2003
    Location
    uk
    Posts
    545
    Mentioned
    0 Post(s)
    Tagged
    0 Thread(s)
    Parkin, thank you so much for your reply.

    Turns out i didn't even have a database setup. The tutorial that i was following was a little lacking in information about the database side of things. So i have made some progress.

    I'm still having basically the same problem. (i'm sure this will be something to do with me not entering in the correct information).

    I downloaded and installed XAMPP, i've used this before for some php stuff and I thought it would be the easiest way to setup mysql and have a nice way for me to mess about with database stuff (phpmyadmin). -- So that's all setup and working.



    I've gone and setup a new database called "MyProject" using phpmyadmin. (I'm following a new tutorial now hence the name change).



    I then changed the information in /config/database.yml to the following...



    I haven't set a default username or password or anything as i was told it should be "root" and "" (blank).

    Is there anything i'm missing / doing wrong? I'm still getting the same rake error.



    Any help is very much appreciated! I just want to get this all setup so i can start messing around and trying to get my head around the language.

  5. #5
    Avid Logophile silver trophy
    ParkinT's Avatar
    Join Date
    May 2006
    Location
    Central Florida
    Posts
    2,345
    Mentioned
    192 Post(s)
    Tagged
    5 Thread(s)
    The username and password MUST match what you set up in MySQL.
    I am certain your host did not permit you to establish a database with "root" and blank.

    {EDIT: I now see, by the screen capture, that you are working on your local box} It is still recommended that you establish a username and password. }

    The idea, which makes perfect sense if you stop to think about it, is that 'database.yml' provides Rails the details it needs to communicate with your database.
    The other important thing to verify is whether you have Rails running in 'development' or 'production' mode.
    There is a parameter in configuration/environment.rb that defines this.
    Look for "ENV['RAILS_ENV']"
    If you are not sure (the 'shotgun' approach) you can simply set the same database, username, password for all three modes in database.yml.

    Good luck.
    Don't be yourself. Be someone a little nicer. -Mignon McLaughlin, journalist and author (1913-1983)


    Git is for EVERYONE
    Literally, the best app for readers.
    Make Your P@ssw0rd Secure
    Leveraging SubDomains


Bookmarks

Posting Permissions

  • You may not post new threads
  • You may not post replies
  • You may not post attachments
  • You may not edit your posts
  •