升级到 Rails 3 后尝试启动服务器时出错 [英] Error when trying to start server after upgrading to Rails 3

查看:46
本文介绍了升级到 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>'

我无法使用 Google 找到这个确切的错误.有谁知道是什么原因造成的?感谢阅读

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

这是控制台输出:

$ 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>'

推荐答案

你真的安装了 rails 3.0.x gem 吗?也许你错过了这一步:)

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

看起来您的 script/rails 脚本无法从 rails gem 中找到包含的文件.您需要为您正在使用的 每个 Ruby 版本(例如 1.8.7 和 1.9.2)分别安装所有需要的 gem.

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 (e.g. 1.8.7 and 1.9.2).

这篇关于升级到 Rails 3 后尝试启动服务器时出错的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

查看全文
登录 关闭
扫码关注1秒登录
发送“验证码”获取 | 15天全站免登陆