views:

92

answers:

3

I am a newbie to Ruby on Rails and I am trying to learn it.

At the moment, I am using ruby tutorial that is about 5 years old.

I am stuck on the 2nd page of the tutorial where I am generating a script or the controller in the command window.

C:\rails> ruby script\generate controller MyTest 
ruby: No such file or directory script/generate (LoadError)

What are my alternative to generating the script? And if possible, can someone show me a tutorial that isn't so outdated?

Much appreciated

+2  A: 

I could be wrong, but that could be a problem with ruby on windows, what version of ruby are you running? Type ruby -v in the console.

Another reason could be that you are probably not in a rails application directory. You have to create a rails application by creating a directory, and then doing rails thedirectory/ in the console, which will initialize all of the rails files for you. Once done, you cd into the directory and should be able to run the script/generate script.

Also, this is by no means a definitive source, but the Rails Guides site is pretty good.

Jorge Israel Peña
ruby -vruby 1.8.6 (2008-08-11 patchlevel 287) [i386-mswin32]
Anraiki
Oh thanks for pointing that out. I just google for a tutorial and it showed me that one and I thought this one would do.
Anraiki
A: 

As for a tutorial, looked at Getting Started with Rails?

rnicholson
Thanks for the link, I have not, and I will
Anraiki
+1  A: 

Seems like you're not in the right folder. If you're following the tutorial you linked, you need to 'cd cookbook' from the c:\rails folder.

Jim
Doh! Didn't think I had to be in the directory of the Cookbook. Thanks :)
Anraiki