Rails控制台无法加载,“找不到gem'rails(= 3.0.0.beta3)ruby”

时间:2012-05-13 23:32:01

标签: ruby-on-rails ruby

我输入Rails控制台开始工作并收到以下错误:

MacBook-Pro:blog agreiner$ rails console
/Users/agreiner/.rvm/gems/ruby-1.9.3-p194/gems/bundler-1.1.3/lib/bundler/resolver.rb:287:in `resolve': Could not find gem 'rails (= 3.0.0.beta3) ruby' in the gems available on this machine. (Bundler::GemNotFound)
from /Users/agreiner/.rvm/gems/ruby-1.9.3-p194/gems/bundler 1.1.3/lib/bundler/resolver.rb:161:in `start'
from /Users/agreiner/.rvm/gems/ruby-1.9.3-p194/gems/bundler 1.1.3/lib/bundler/resolver.rb:128:in `block in resolve'
from /Users/agreiner/.rvm/gems/ruby-1.9.3-p194/gems/bundler-1.1.3/lib/bundler/resolver.rb:127:in `catch'
from /Users/agreiner/.rvm/gems/ruby-1.9.3-p194/gems/bundler-1.1.3/lib/bundler/resolver.rb:127:in `resolve'
from /Users/agreiner/.rvm/gems/ruby-1.9.3-p194/gems/bundler-1.1.3/lib/bundler/definition.rb:192:in `resolve'
from /Users/agreiner/.rvm/gems/ruby-1.9.3-p194/gems/bundler 1.1.3/lib/bundler/definition.rb:127:in `specs'
from /Users/agreiner/.rvm/gems/ruby-1.9.3-p194/gems/bundler-1.1.3/lib/bundler/definition.rb:161:in `requested_specs'
from /Users/agreiner/.rvm/gems/ruby-1.9.3-p194/gems/bundler-1.1.3/lib/bundler/environment.rb:23:in `requested_specs'
from /Users/agreiner/.rvm/gems/ruby-1.9.3-p194/gems/bundler 1.1.3/lib/bundler/runtime.rb:11:in `setup'
from /Users/agreiner/.rvm/gems/ruby-1.9.3-p194/gems/bundler-1.1.3/lib/bundler.rb:107:in `setup'
from /Users/agreiner/blog/config/boot.rb:5:in `<top (required)>'
from /Users/agreiner/.rvm/rubies/ruby-1.9.3-p194/lib/ruby/site_ruby/1.9.1/rubygems/custom_require.rb:36:in `require'
from /Users/agreiner/.rvm/rubies/ruby 1.9.3-p194/lib/ruby/site_ruby/1.9.1/rubygems/custom_require.rb:36:in `require' from >script/rails:8:in `<main>'

我几天前开始使用Rails,所以我分析错误的能力仅限于我的谷歌能力。我没有找到关于Could not find gem 'rails(=3.0.0beta3) ruby

的任何内容

有人能指出我正确的方向吗?

2 个答案:

答案 0 :(得分:1)

看起来rails gem已安装在某一点,但之后只是部分卸载或已安装,但位于意外位置。第一步是尝试重新安装。我不确定您是否正在使用系统ruby,或者是通过rvm / ruby​​-build安装的系统,因此很难提供比此更多的建议。

答案 1 :(得分:0)

找不到你的rails gem。 先试试:

gem install rails