在任何来源中都找不到rake-0.8.7(Bundler :: GemNotFound)

时间:2012-04-05 09:37:51

标签: ruby ruby-on-rails-3 ruby-on-rails-3.1 rubygems

我使用的是Ruby 1.8.7和Rails 2.3.5版本。当我尝试启动服务器时,它会抛出以下错误。 当我列出宝石时,它会显示那里的耙子但不同的版本

actionmailer (2.3.5)
actionpack (2.3.5)
activerecord (2.3.5)
activeresource (2.3.5)
activesupport (2.3.5)
bundler (1.1.3)
fattr (2.2.1)
git (1.2.5)
postgres-pr (0.6.3)
rack (1.0.1)
rails (2.3.5)
rake (0.9.2.2)
rush (0.6.8)
session (3.1.0)

请帮我解决这个问题。

D:/ruby/lib/ruby/gems/1.8/gems/bundler-1.1.3/lib/bundler/spec_set.rb:90:in `materialize': Could not find rake-0.8.7 in any of the sources (Bundler::GemNotFound)

        from D:/ruby/lib/ruby/gems/1.8/gems/bundler-1.1.3/lib/bundler/spec_set.rb:83:in `map!'
        from D:/ruby/lib/ruby/gems/1.8/gems/bundler-1.1.3/lib/bundler/spec_set.rb:83:in `materialize'
        from D:/ruby/lib/ruby/gems/1.8/gems/bundler-1.1.3/lib/bundler/definition.rb:127:in `specs'
        from D:/ruby/lib/ruby/gems/1.8/gems/bundler-1.1.3/lib/bundler/definition.rb:172:in `specs_for'
        from D:/ruby/lib/ruby/gems/1.8/gems/bundler-1.1.3/lib/bundler/runtime.rb:11:in `setup'
        from D:/ruby/lib/ruby/gems/1.8/gems/bundler-1.1.3/lib/bundler.rb:114:in `setup'
        from D:/ruby/lib/ruby/gems/1.8/gems/bundler-1.1.3/lib/bundler.rb:119:in `require'
        from D:/safecellweb/config/boot.rb:116:in `load_gems'
        from D:/ruby/lib/ruby/gems/1.8/gems/rails-2.3.5/lib/initializer.rb:164:in `process'
        from D:/ruby/lib/ruby/gems/1.8/gems/rails-2.3.5/lib/initializer.rb:113:in `send'
        from D:/ruby/lib/ruby/gems/1.8/gems/rails-2.3.5/lib/initializer.rb:113:in `run'
        from D:/safecellweb/config/environment.rb:10
        from D:/ruby/lib/ruby/site_ruby/1.8/rubygems/custom_require.rb:36:in `gem_original_require'
        from D:/ruby/lib/ruby/site_ruby/1.8/rubygems/custom_require.rb:36:in `require'
        from D:/ruby/lib/ruby/gems/1.8/gems/activesupport-2.3.5/lib/active_support/dependencies.rb:156:in `require'
        from D:/ruby/lib/ruby/gems/1.8/gems/activesupport-2.3.5/lib/active_support/dependencies.rb:521:in `new_constants_in'
        from D:/ruby/lib/ruby/gems/1.8/gems/activesupport-2.3.5/lib/active_support/dependencies.rb:156:in `require'
        from D:/ruby/lib/ruby/gems/1.8/gems/rails-2.3.5/lib/commands/server.rb:84
        from D:/ruby/lib/ruby/site_ruby/1.8/rubygems/custom_require.rb:36:in `gem_original_require'
        from D:/ruby/lib/ruby/site_ruby/1.8/rubygems/custom_require.rb:36:in `require'
        from script/server:4

3 个答案:

答案 0 :(得分:4)

实际上你的rake版本是0.9.2

虽然您的应用需要0.8.7

所以首先通过此命令卸载rake 0.9.2

gem uninstall rake -v=0.9.2

然后通过此命令安装rake 0.8.7

gem install rake -v=0.8.7

希望你的问题能解决........

答案 1 :(得分:1)

运行这些命令,问题将解决 第1步:安装rake gem install rake -v' 0.8.7'

第2步:安装bundler gem install bundler

第3步:捆绑安装

它将解决问题..

答案 2 :(得分:0)

即使我在使用RubyMine运行应用程序时遇到了同样的问题。

我采取的措施: 1)我在我的机器上安装了新的Ruby。 2)在环境变量中改变了Ruby的路径。 3)使用以下步骤更改了RubyMine中Ruby的路径: -    a)点击文件 - > 设置 - > Ruby SDK和Gems 4)然后运行 bundle install