We help IT Professionals succeed at work.

Installed Ruby on Instant Rails fine and the cookbook workd but can't seem to get a new app to work...

ripnoel asked
Hi, I'm brand new to trying to learn ROR. I just downloaded and installed Ruby on Instant Rails and all went well... I believe... Cookbook app included w/ Ruby on Instant Rails v2.02 works fine after install.

Next I set up  a new app: my_app
chose my Instant Rails "rails_apps" subdirectory as my workspace but of course down one level into the my_app subdirectory  Fired it up my_app (Mongrel running) and next want to setup a controller... here is where I'm having problems.

When I open a Ruby console window and navigate into my new my_app subdirectory and start typing commands.... nothing seems to be working. Even up a level from my my_app subdirectory in the rails_apps directory no commands work here either.

What is my problem.....????? HELP APPRECIATED!

Watch Question

Not sure if you have this link but has quite a bit of information and troubleshooting so take a look at http://api.rubyonrails.org/ and see if will answer the question for the problem you are having.

what commands are you typing?


script/generate  or script/generate controller Say

Receive this message:

I get the message that "script" is not recognized as an internal or external command, operable program or batch file.

Thanks for trying to help!

First, make sure you open a console window using the InstantRails option "Open Ruby Console Window" by right-clicking the red I in the system tray.  That loads all the ruby/mysql paths.

An easy way to check is type:
> ruby -v
It should return "ruby 1.8.6" or something like that. If it doesn't, then you don't have ruby on the path so it can't be found to run your ruby script!

Next, on windows, you normally have to provide the program name, then the command:
ruby script/generate Say

Windows doesn't support she-bangs (where the program that runs a file is on the first line of the file: #!/usr/local/bin"

So, if you can run "ruby -v" and try the command with the ruby name in front of it, that should do the trick.

If not, let us know what error you're getting and we'll go from there.


Well that did it... adding "ruby" name in front of it did the trick. Will I have to continue to add the ruby mane in front of all commands? Thanks again!
Well, you might be able to associate .rb file with the ruby.exe interpreter.  BUT, that would mean double clicking on them would run them, not open them in your text editor.  So, I've never set it up that way.  I do set up system batch files:  "ss.bat" for "ruby script/server" and stuff like that.

Explore More ContentExplore courses, solutions, and other research materials related to this topic.