这不是我第一次遇到这种情况,但下面是一个具体的例子:
$ bundle update rails
Fetching source index for http://rubygems.org/
Bundler could not find compatible versions for gem "builder":
In Gemfile:
rails (~> 3.0.0) ruby depends on
builder (~> 2.1.2) ruby
hoptoad_notifier (>= 0) ruby depends on
builder (3.0.0)因此,邦德勒声称,hoptoad_notifier创业板依赖于3.0.0版本的构建器。但事实并非如此,它只需要构建器>= 0。
$ gem dependency hoptoad_notifier
Gem hoptoad_notifier-2.4.11
actionpack (>= 0, development)
activerecord (>= 0, development)
activesupport (>= 0, runtime)
bourne (>= 0, development)
builder (>= 0, runtime)
nokogiri (>= 0, development)
shoulda (>= 0, development)为什么邦德勒认为hoptoad_notifier依赖于构建器3.0.0?
从Gemfile和Gemfile.lock中选择的位:
source "http://rubygems.org"
gem 'rails', '~> 3.0.0'
gem 'hoptoad_notifier'
...a bunch of testing gems, custom gems, etc.Gemfile.lock
GEM
remote: http://rubygems.org/
specs:
actionmailer (2.3.14)
actionpack (= 2.3.14)
...
builder (3.0.0)
...
cucumber (1.2.0)
builder (>= 2.1.2)
diff-lcs (>= 1.1.3)
gherkin (~> 2.10.0)
json (>= 1.4.6)
...
hoptoad_notifier (2.4.11)
activesupport
builder
... no other mentions of builder发布于 2012-12-26 23:00:13
我认为这是一种解决办法,而不是问题的答案,所以我将暂时搁置这个问题,看看是否有更好的答案。
我找到了不同的方法来解决这个问题(在特定的gems上使用包更新、修改Gemfile、运行bundle安装),但是对于各种依赖项,我继续遇到某种形式的错误。这看起来真的是邦德勒的问题。(我使用的是v1.0.22,升级使情况更糟。)最终,让我摆脱困境的是删除Gemfile.lock并运行包安装,让Bundler从零开始解决所有依赖关系。当然,这并不理想,因为您拥有锁文件的全部原因是为了锁定应用程序的依赖关系。但是,由于我无论如何都要将Rails升级到v3,所以在这种情况下它是可以接受的。
https://stackoverflow.com/questions/14046229
复制相似问题