1

我正在使用 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
4

3 回答 3

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

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

于 2012-04-05T09:43:15.460 回答
1

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

第 2 步:安装捆绑器gem install bundler

第 3 步:捆绑安装

它将解决问题..

于 2014-04-23T06:15:15.260 回答
0

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

我采取的步骤: 1)我在我的机器上安装了新的 Ruby。2) 更改环境变量中 Ruby 的路径。3) 使用以下步骤在 RubyMine 中更改 Ruby 的路径:- a) 单击File -> Settings -> Ruby SDK and Gems 4) 然后运行​​bundle install

于 2013-10-05T04:24:03.547 回答