Bundler找不到兼容版本的宝石

时间:2012-05-31 09:18:45

标签: ruby-on-rails gem

我的本​​地宝石是:

actionmailer (3.2.4.rc1, 3.2.3)
actionpack (3.2.4.rc1, 3.2.3)
activemodel (3.2.4.rc1, 3.2.3)
activerecord (3.2.4.rc1, 3.2.3)
activeresource (3.2.3)
activesupport (3.2.4.rc1, 3.2.3)
arel (3.0.2)
builder (3.0.0)
bundler (1.1.3)
coffee-script-source (1.3.3)
erubis (2.7.0)
hike (1.2.1)
i18n (0.6.0)
journey (1.0.3)
json (1.7.3)
mail (2.4.4)
mime-types (1.18)
multi_json (1.3.6)
polyglot (0.3.3)
rack (1.4.1)
rack-cache (1.2)
rack-ssl (1.3.2)
rack-test (0.6.1)
rails (3.2.3)
railties (3.2.4.rc1, 3.2.3)
rake (0.9.2.2)
rdoc (3.12)
rubygems-bundler (1.0.2)
rvm (1.11.3.3)
sprockets (2.1.3)
thor (0.14.6)
tilt (1.3.3)
treetop (1.4.10)
tzinfo (0.3.33)

我的Gemfile看起来像:

source 'https://rubygems.org'

gem 'rails', '3.2.3'

group :development, :test do
  gem 'sqlite3' ,'1.3.6'
  gem 'rspec-rails', '2.10.0'
end


# Gems used only for assets and not required
# in production environments by default.
group :assets do
  gem 'sass-rails',   '3.2.4'
  gem 'coffee-rails', '3.2.2'
  gem 'uglifier', '1.2.3'
end

gem 'jquery-rails' ,'2.0.0'

group :test do
   gem 'capybara' , '1.1.2'
end

group :production do
  gem 'pg' , '0.12.2'
end

但是在执行bundle install --without production时,我得到了

Bundler could not find compatible versions for gem "railties":
  In Gemfile:
    rails (= 3.2.3) ruby depends on
      railties (= 3.2.3) ruby

    jquery-rails (= 2.0.0) ruby depends on
      railties (3.2.4.rc1)

即使我可以在我的本地宝石中看到栏杆3.2.3和3.2.4.rc1,为什么bundle无法安装jquery-rail 2.0.0。当我已安装此版本时,为什么要问我Rails 3.2.3?

2 个答案:

答案 0 :(得分:1)

是的,但是捆绑商不会让你使用宝石的两个不同版本。您有版本依赖项冲突,因为rails 3.2.3取决于railties 3.2.3jquery-rails 2.0.0取决于railties 3.2.4.rc1

您应该使用较旧的jquery-rails版本或较新的rails版本。

答案 1 :(得分:1)

我遇到了类似的问题,我能够通过注释导致依赖性问题的gem(s)来运行bundle,取消注释gem,然后运行{{1再次。

在您的情况下,我会尝试评论并取消注释bundle