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
I could be wrong, but that could be a problem with ruby on windows, what version of ruby are you running? Type
ruby -vin 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, youcdinto the directory and should be able to run thescript/generatescript.Also, this is by no means a definitive source, but the Rails Guides site is pretty good.