简体   繁体   中英

Error when trying to start server after upgrading to Rails 3

I've just upgraded to Rails 3, using the instructions from this railscast . When I try to start the server, this is what happens:

$ rails s
script/rails:6:in `require': no such file to load -- rails/commands (LoadError)
    from script/rails:6:in `<main>'

I can't find this exact error using Google. Anyone know what is causing this? Thanks for reading

EDIT:

Here's the console output:

$ rvm 1.9.2
$ rails -v
Rails 3.0.1
$ ruby -v
ruby 1.9.2p0 (2010-08-18 revision 29036) [x86_64-darwin10.4.0]
$ rails new . -d sqlite3
(all the overwrite checking stuff happens here)
$ bundle install
...
Your bundle is complete! It was installed into /Users/ben/.rvm/gems/ruby-1.9.2-p0
$ rails s
script/rails:6:in `require': no such file to load -- rails/commands (LoadError)
    from script/rails:6:in `<main>'
$ rvm list
rvm rubies
=> ruby-1.9.2-p0 [ x86_64 ]
$ ruby -v
ruby 1.9.2p0 (2010-08-18 revision 29036) [x86_64-darwin10.4.0]
$ rails -v
script/rails:6:in `require': no such file to load -- rails/commands (LoadError)
    from script/rails:6:in `<main>'

Have you actually installed the rails 3.0.x gem? Maybe you missed this step :).

It looks like your script/rails script cannot find the included file from rails gem. You need to install all needed gems separately for each version of Ruby you're using (eg 1.8.7 and 1.9.2).

Maybe you can just reinstall your rubygem, or update it.

Rubygem versions should fit to your Ruby versions. For every Ruby version you installed separated Gems needed.

May I ask did you use any 'sudo' with RVM installations? Better to avoid, see here: http://rvm.beginrescueend.com/rubies/rubygems/

Can you list here please your "gem list" after switched to default Ruby version you want to use? Also "rvm list" "ruby -v" "gem -v" and your OS please.

Also wise to write to forum at the section you downloaded Railscasts' video, because maybe others will have the same problem.

The technical post webpages of this site follow the CC BY-SA 4.0 protocol. If you need to reprint, please indicate the site URL or the original address.Any question please contact:yoyou2525@163.com.

 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM