【问题标题】:Why does bundle install not use the version of bundler in Gemfile though its available?为什么 bundle install 不使用 Gemfile 中的 bundler 版本,尽管它可用?
【发布时间】:2012-07-31 20:32:04
【问题描述】:

当我做一个

bundle install --path vendor/bundle

在我的应用程序中,我收到以下错误。

Bundler could not find compatible versions for gem "bundler":
  In Gemfile:
    bundler (= 1.0.18) java

  Current Bundler version:
    bundler (1.1.5)

This Gemfile requires a different version of Bundler.
Perhaps you need to update Bundler by running `gem install bundler`?

我的宝石列表显示我有提到的宝石

*** LOCAL GEMS ***

bundler (1.1.5, 1.0.22, 1.0.18)

我的 gem 文件看起来像这样

gem "rake", "0.9.2"
gem "activerecord-jdbc-adapter", "1.2.0"
gem "activerecord-jdbcmysql-adapter", "1.2.0"
gem "acts_as_tree", "0.1.1"
gem "bundler", "1.0.18", :require => "bundler"
gem "database_cleaner", "0.6.7"
gem "jdbc-mysql", "5.1.13"
gem "jruby-jars", "1.6.2"
gem "jruby-rack", "1.1.3"
gem "jruby-openssl", "0.7.4"
gem "net-scp", "1.0.4"
gem "net-ssh", "2.2.1"
gem 'uuidtools', "2.1.1"
gem 'nokogiri', "1.5.0"

我该如何解决这个问题?我使用 jruby-1.6.3 和 rails 3.0.10。

【问题讨论】:

  • 为什么要指定捆绑器版本?无论如何,bundler 不应该在 Gemfile 中,因为它是处理 Gemfile 的程序!

标签: ruby-on-rails ruby-on-rails-3 rubygems bundler


【解决方案1】:

你有没有试过 - 从 gemfile 中删除 bundler - 将其设置为捆绑器版本以用于捆绑它 - 反之亦然:使用捆绑器版本来捆绑您在 gem 文件中所需的内容

但正如 Anthony 所说,您有理由将其包含在 Gemfile 中吗?

【讨论】:

  • 嗯,该项目需要这个特定版本的捆绑器,因为特定版本还有其他依赖项
  • 然后我会尝试第二个选项 - 运行 gemfile 中所需的捆绑程序版本,如果 bundle exec bundle 有效,我会尝试。
  • 使用 bundle exec 刚刚创建了一个新错误 'Bundler::GemNotFound: Could not find gem 'rails (= 3.0.10) java' in the gems available on this machine'。 gem 列表 rails 确实显示了该版本的 rails。
猜你喜欢
  • 2019-12-01
  • 2019-02-08
  • 1970-01-01
  • 1970-01-01
  • 2017-09-04
  • 1970-01-01
  • 1970-01-01
  • 1970-01-01
  • 2013-12-10
相关资源
最近更新 更多