SitePoint Sponsor

User Tag List

Results 1 to 4 of 4

Hybrid View

  1. #1
    SitePoint Enthusiast
    Join Date
    Jan 2007
    Posts
    72
    Mentioned
    0 Post(s)
    Tagged
    0 Thread(s)

    **HELP** Ruby Newbie!!!

    ust spent some time downloading Locomotive on my PB.

    I've got the ruby home page at 127.0.0.1:3000 which is good (so far)

    However - I have 3 steps to complete:

    1.
    Create your databases and edit config/database.yml

    Rails needs to know your login and password.
    DB Created:-) then...for this one, i have used unix and got to the area but not sure how to edit database.yml
    2.
    Use script/generate to create your models and controllers

    To see all available options, run it without parameters.
    3.
    Set up a default route and remove or rename this file

    Routes are setup in config/routes.rb.


    Any idea how to get the last 3 steps up and running?

    cheers everyone...

    craig

  2. #2
    SitePoint Guru
    Join Date
    Aug 2005
    Posts
    986
    Mentioned
    0 Post(s)
    Tagged
    0 Thread(s)
    1) database.yml is in the folder where you ran the `rails your-folder` command. It's your-folder/config/database.yml.

    2) Open a terminal/console in your-folder and then run `./script/generate controller your-controller` or `./script/generate model your-model`.

    3) Check the your-folder/config/routes/rb file. I think there's info in there on how to create a default route. You can delete your-folder/public/index.html after you set the default route. This makes sure that *your* page shows up at localhost:3000 instead of Rails' default page.

  3. #3
    SitePoint Enthusiast
    Join Date
    Jan 2007
    Posts
    72
    Mentioned
    0 Post(s)
    Tagged
    0 Thread(s)
    sorry - still not sure what i'm meant to be doing...

  4. #4
    SitePoint Guru
    Join Date
    Aug 2005
    Posts
    986
    Mentioned
    0 Post(s)
    Tagged
    0 Thread(s)
    Well, first you need to find your project folder. This is the folder of your application, everything is in that folder (code, database configuration, etc.). Once you know where that folder is you can perform the tree steps I posted above. (please ask if you need further info on doing the 3 steps)

    Now, I don't use locomotive so I don't know if it's different from a manual installation. You project folder is in the place where you ran the `rails` command. Maybe locomotive ran it for you, if that's the case you should be able to find where the project folder is by reading locomotive's docs.

    Locomotive's website says:

    Locomotive development has come to an end. With the advent of a fully-functional Ruby and Rails stack on Leopard, Locomotive is no longer needed. Also, I don't have the time anymore. Thanks for using it.
    So maybe you should try another installation. The manual installation is very easy. I assume that you already have Ruby (maybe it's preinstalled, otherwise you have to install it). You can check if you have Ruby by opening a terminal/console window and typing `irb`. If you see a Ruby prompt then you have Ruby, otherwise you have to install it first.

    Ruby has a nifty tool called RubyGems that installes Gem packages for you (Rails is a gem package). You can check if you have RubyGems by typing `gem` at the console. If it's installed then you can type `gem install rails --include-dependencies` to install Rails.

    So know you have a fresh Rails installation. To create a web application you have to create a project folder. Rails does this for you if you run the rails command like this: `rails your-folder`. This creates a folder called `your-folder` that has all kinds of stuff in it, like a Rails webserver and an application skeleton. At this point you can perform the 3 steps.


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
  •