2

我在 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

谁能指出我正确的方向?

4

2 回答 2

1

看起来 rails gem 是在某个时候安装的,但后来只是部分卸载了,或者安装在了一个意外的位置。第一步是尝试重新安装。我不确定您使用的是系统 ruby​​,还是通过 rvm/ruby-build 安装的系统,所以很难给出比这更多的建议。

于 2012-05-13T23:36:54.633 回答
0

它找不到您的 Rails 宝石。先试试:

宝石安装导轨

于 2012-05-14T09:17:15.723 回答