简体   繁体   English

升级到Rails 3后尝试启动服务器时出错

[英]Error when trying to start server after upgrading to Rails 3

I've just upgraded to Rails 3, using the instructions from this railscast . 我刚刚使用此railscast的说明升级到Rails 3。 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. 我无法使用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? 你真的安装了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. 看起来您的script/rails脚本无法从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). 您需要为您正在使用的每个 Ruby版本单独安装所有需要的gem(例如1.8.7和1.9.2)。

Maybe you can just reinstall your rubygem, or update it. 也许你可以重新安装rubygem,或者更新它。

Rubygem versions should fit to your Ruby versions. Rubygem版本应该适合您的Ruby版本。 For every Ruby version you installed separated Gems needed. 对于每个Ruby版本,您需要安装单独的Gems。

May I ask did you use any 'sudo' with RVM installations? 请问您是否在RVM安装中使用了任何“sudo”? Better to avoid, see here: http://rvm.beginrescueend.com/rubies/rubygems/ 最好避免,请看这里: http//rvm.beginrescueend.com/rubies/rubygems/

Can you list here please your "gem list" after switched to default Ruby version you want to use? 你可以在这里列出你想要使用的默认Ruby版本后的“宝石列表”吗? Also "rvm list" "ruby -v" "gem -v" and your OS please. 另外“rvm list”“ruby -v”“gem -v”和你的操作系统请。

Also wise to write to forum at the section you downloaded Railscasts' video, because maybe others will have the same problem. 在你下载Railscasts视频的部分写论坛也是明智的,因为也许其他人会遇到同样的问题。

声明:本站的技术帖子网页,遵循CC BY-SA 4.0协议,如果您需要转载,请注明本站网址或者原文地址。任何问题请咨询:yoyou2525@163.com.

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