Bundle不能使用旧版本的bundler

时间:2013-03-18 06:59:19

标签: ruby-on-rails-3 bundler

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

然后我在这里找到一个帖子How to bundle install when your Gemfile requires an older version of bundler?

但在我'捆绑 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

如何安装和锁定正确版本的bundler?真的很感激!!

1 个答案:

答案 0 :(得分:-1)

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