【问题标题】:Why could Bundler not find compatible versions, but I can?为什么 Bundler 找不到兼容的版本,但我可以?
【发布时间】:2019-08-03 17:03:41
【问题描述】:

我在bundle upgradeing 一些宝石,遇到一些我觉得奇怪的错误:

Bundler could not find compatible versions for gem "tzinfo":
  In Gemfile:
    rails (= 5.2.3) was resolved to 5.2.3, which depends on
      activesupport (= 5.2.3) was resolved to 5.2.3, which depends on
        tzinfo (~> 1.1)

    tzinfo-data was resolved to 1.2019.2, which depends on
      tzinfo (>= 1.0.0)

tzinfo 1.1 不能满足这个要求吗? >= 1.0.0 不只是 tzinfo (~> 1.1) 的一个子集吗?

Bundler could not find compatible versions for gem "mongo":
  In Gemfile:
    mongo (~> 2.4.1)

    mongoid (~> 6.0) was resolved to 6.2.1, which depends on
      mongo (< 3.0.0, >= 2.4.1)

为什么 mongo 2.4.1 不能满足这些要求?

【问题讨论】:

  • 根据您显示的信息,这两个依赖项都应该是可解析的。如果仍然失败,请编辑您的问题并添加您的Gemfile,以及完整的bundle upgrade 输出。可能缺少一些东西。

标签: ruby mongoid bundler tzinfo


【解决方案1】:

tzinfo (~&gt; 1.1) 仅相当于 '>= 1.1.0, >= 1.0.0 不是~&gt; 1.1 的子集。使用版本1.1 应该会有所帮助。

我看不出 mongo 不应该在版本 2.4.1 中工作的原因,但尝试指定确切的版本:

gem 'mongo', '2.4.1'

Rubygem guides 中有关 ~&gt; 的更多信息。

【讨论】:

  • ~&gt; 1.1 实际上等价于&gt;= 1.1, &lt; 2.0。 twiddlewaka 只考虑最后指定的版本部分。
猜你喜欢
  • 1970-01-01
  • 2011-10-31
  • 2017-07-17
  • 2018-02-09
  • 2014-05-26
  • 2014-03-14
  • 2013-03-13
  • 2019-05-07
  • 2016-02-17
相关资源
最近更新 更多