Error when generating scaffold
I use RVM with ruby 1.9.2 and Rails. When I try to generate a scaffold for my Rails app, I ge开发者_JAVA百科t this error:
<internal:lib/rubygems/custom_require>:29:in `require': no such file to load -- script/../config/boot (LoadError)
from <internal:lib/rubygems/custom_require>:29:in `require'
from script/generate:2:in `<main>'
Is there something wrong with rubygems? RVM?
Make sure you are in the root of your rails application, not just wherever you happen to be when you open your terminal.
E.g. if you ran "rails new foo", that will create a directory called "foo" which contains all the files for your application. You need to be in the directory "foo" whenever you run a rails generator.
Ok, so I fixed the problem I was experiencing.
Basically, I was using ruby version 1.9.2 and rails version 2.2.2. I was only using this version of rails because I am following a rails book and wanted to use the same version that it's examples were written in.
Anyway, when I use ruby version 1.8.7 it seems to work fine. I also tried using ruby 1.9.2 and rails 3.0.3 and it all works fine too.
So, I think your problem may be a conflict between the version of ruby and rails that you're using.
So, in summary, to fix the problem above I changed my version of ruby to 1.8.7 while using rails 2.2.2
精彩评论