0

我在我的 Rails 应用程序中进行了“捆绑安装”。首先,我收到以下消息:

Bundler could not find compatible versions for gem "bundler":
  In Gemfile:
    rails (= 3.0.1) ruby depends on
      bundler (~> 1.0.0) ruby

  Current Bundler version:
    bundler (1.3.4)

This Gemfile requires a different version of Bundler.

然后我在这里找到一个线程如何bundle install当您的 Gemfile 需要旧版本的捆绑程序时?

但是在我'$ bundle 1.0.22 install'之后,我收到了这样的消息:

/home/chinseone/.rvm/rubies/ruby-2.0.0-p0/lib/ruby/site_ruby/2.0.0/rubygems/core_ext/kernel_require.rb:45:in `require': cannot load such file -- rubygems/format (LoadError)
from /home/chinseone/.rvm/rubies/ruby-2.0.0-p0/lib/ruby/site_ruby/2.0.0/rubygems/core_ext/kernel_require.rb:45:in `require'
from /home/chinseone/.rvm/gems/ruby-2.0.0-p0/gems/bundler-1.0.22/lib/bundler/source.rb:5:in `<top (required)>'
from /home/chinseone/.rvm/gems/ruby-2.0.0-p0/gems/bundler-1.0.22/lib/bundler/dsl.rb:14:in `initialize'
from /home/chinseone/.rvm/gems/ruby-2.0.0-p0/gems/bundler-1.0.22/lib/bundler/dsl.rb:6:in `new'
from /home/chinseone/.rvm/gems/ruby-2.0.0-p0/gems/bundler-1.0.22/lib/bundler/dsl.rb:6:in `evaluate'
from /home/chinseone/.rvm/gems/ruby-2.0.0-p0/gems/bundler-1.0.22/lib/bundler/definition.rb:17:in `build'
from /home/chinseone/.rvm/gems/ruby-2.0.0-p0/gems/bundler-1.0.22/lib/bundler.rb:138:in `definition'
from /home/chinseone/.rvm/gems/ruby-2.0.0-p0/gems/bundler-1.0.22/lib/bundler/cli.rb:219:in `install'
from /home/chinseone/.rvm/gems/ruby-2.0.0-p0/gems/bundler-1.0.22/lib/bundler/vendor/thor/task.rb:22:in `run'
from /home/chinseone/.rvm/gems/ruby-2.0.0-p0/gems/bundler-1.0.22/lib/bundler/vendor/thor/invocation.rb:118:in `invoke_task'
from /home/chinseone/.rvm/gems/ruby-2.0.0-p0/gems/bundler-1.0.22/lib/bundler/vendor/thor.rb:263:in `dispatch'
from /home/chinseone/.rvm/gems/ruby-2.0.0-p0/gems/bundler-1.0.22/lib/bundler/vendor/thor/base.rb:386:in `start'
from /home/chinseone/.rvm/gems/ruby-2.0.0-p0/gems/bundler-1.0.22/bin/bundle:13:in `<top (required)>'
from /home/chinseone/.rvm/gems/ruby-2.0.0-p0/bin/bundle:23:in `load'
from /home/chinseone/.rvm/gems/ruby-2.0.0-p0/bin/bundle:23:in `<main>'
from /home/chinseone/.rvm/gems/ruby-2.0.0-p0/bin/ruby_noexec_wrapper:14:in `eval'
from /home/chinseone/.rvm/gems/ruby-2.0.0-p0/bin/ruby_noexec_wrapper:14:in `<main>'

而对应的内容是:

# If there are no unresolved deps, then we can use just try
# normal require handle loading a gem from the rescue below.

if Gem::Specification.unresolved_deps.empty? then
  return gem_original_require(path)
end

如何安装并锁定到正确版本的捆绑程序?非常感谢!!

4

1 回答 1

-1

转到您的 Gemfile.lock 更改您的捆绑要求

于 2014-02-07T19:51:41.343 回答