SitePoint Sponsor

User Tag List

Results 1 to 7 of 7
  1. #1
    SitePoint Zealot santha's Avatar
    Join Date
    Jan 2007
    Posts
    102
    Mentioned
    0 Post(s)
    Tagged
    0 Thread(s)

    Stuck on page 42 of the book "Ruby on Rails"

    Hello!
    I'm new to RoR. Just got "Build your own Ruby on Rails web applications". On page 42, a Rails command is written -

    $ rails shovell
    create
    create app/controllers
    create app/helpers
    .......etc..

    What is this command about? And,
    Where do we enter this command?? Is it to be entered in a text editor or somwhere in Instant Rails??
    Again, I'm very new to programming.

  2. #2
    SitePoint Wizard bronze trophy
    Join Date
    Oct 2001
    Location
    Vancouver BC Canada
    Posts
    2,037
    Mentioned
    5 Post(s)
    Tagged
    0 Thread(s)
    Because this is a relatively new way of building web applications and it has been made available on various platforms you'll have to read and then re-read much of the material to make sure it applies to your setup.

    First things first. The command you refer to uses the RoR framework to create a new application called 'shovell'

    rails is the command and shovell is the target.

    You run this command in a terminal window and that depends greatly on the platform you're using; windows, linux, mac... I'm not using Instant Rails anymore so, I can't be certain but I think it's called the 'rails console' or something similar.

    Does that help?
    Andrew Wasson | www.lunadesign.org
    Principal / Internet Development

  3. #3
    SitePoint Evangelist
    Join Date
    Feb 2006
    Location
    Worcs. UK
    Posts
    404
    Mentioned
    0 Post(s)
    Tagged
    0 Thread(s)
    Yes, you run the rails <application_name> at the command prompt. You need to run it in the directory or folder where you want the application to be installed. So on a windows system where you you want to install the new rails application into c:\web you would:
    • Select Run in the start menu.
    • enter cmd and click on OK : that will open a windows console.
    • enter cd c:\web to get to the target directory.
    • then enter rails shovell to create an application call shovell

    The application will then be created at c:\web\shovell\

  4. #4
    SitePoint Zealot santha's Avatar
    Join Date
    Jan 2007
    Posts
    102
    Mentioned
    0 Post(s)
    Tagged
    0 Thread(s)
    In Instant Rails, its called "Ruby Console", but,
    When I enter "$ rails shovell" into the command prompt, it gives this error message-
    '$ is not recognized as an internal or external command, operable programme or batch file'. What is this?
    & which is the best text editor for rails, which one do you use?

  5. #5
    SitePoint Wizard bronze trophy
    Join Date
    Oct 2001
    Location
    Vancouver BC Canada
    Posts
    2,037
    Mentioned
    5 Post(s)
    Tagged
    0 Thread(s)
    Ya sorry about that.
    I may have confused issues here.

    Ruby Console is used for entering Ruby commands and working directly with your rails application. Some of the exercises in the book ask you to instantiate various objects and manipulate the database through the Ruby console.

    What you need to do is open a simple command screen. We used to call them dos windows or command prompts. You can open one through instant rails but I can't remember how. You can also use the start menu and "Run" CMD. Then you can change directories to wherever your application is. From there you can enter rails commands.

    I think if you go back over the information in the book it has a pretty good windows tutorial on using Instant Rails.
    Andrew Wasson | www.lunadesign.org
    Principal / Internet Development

  6. #6
    SitePoint Zealot santha's Avatar
    Join Date
    Jan 2007
    Posts
    102
    Mentioned
    0 Post(s)
    Tagged
    0 Thread(s)

    Lightbulb

    Thanks for a quick reply.
    If you install Instant Rails, then Windows Command Prompt won't work, because Instant Rails does not modify anything in it, so, "Ruby Console" in Instant Rails has to be used.

    I tried it & got into 1 more problem. I typed $ rails shovell & it gave error= $ is illegal... or something like that.
    But, I found out in another post.==>

    http://www.sitepoint.com/forums/showthread.php?t=483933

    Thanks Awasson.

  7. #7
    SitePoint Wizard bronze trophy
    Join Date
    Oct 2001
    Location
    Vancouver BC Canada
    Posts
    2,037
    Mentioned
    5 Post(s)
    Tagged
    0 Thread(s)
    Ok, that makes sense now. You are right in your question on the other thread it should be "rails shovell"

    Keep us posted.
    Andrew Wasson | www.lunadesign.org
    Principal / Internet Development


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
  •