【问题标题】:Single dependency in gemfile result on conflictgemfile中的单一依赖导致冲突
【发布时间】:2017-04-17 23:00:14
【问题描述】:

我是 Ruby 和 Rails 的新手,我正在尝试遵循 Spree 的说明,但在执行 bundle install 时遇到了依赖关系解析问题。我用谷歌搜索了一堆类似的问题,但在所有这些问题中,gemfile 中都有几个“根”gem。在我的情况下,我有单个根 spree (~> 3.1.0.rc1),甚至是相同的依赖树。看起来单个 gem rails 4.2.6 取决于actionpack 5.0.2 和 4.2.6 的两个版本。怎么可能?

Bundler could not find compatible versions for gem "actionpack":
In Gemfile:
  spree (~> 3.1.0.rc1) was resolved to 3.1.0.rc1, which depends on
    spree_core (= 3.1.0.rc1) was resolved to 3.1.0.rc1, which depends on
      rails (~> 4.2.6) was resolved to 4.2.6, which depends on
        actionpack (= 5.0.2)

  spree (~> 3.1.0.rc1) was resolved to 3.1.0.rc1, which depends on
    spree_core (= 3.1.0.rc1) was resolved to 3.1.0.rc1, which depends on
      rails (~> 4.2.6) was resolved to 4.2.6, which depends on
        actionpack (= 5.0.2)

  spree (~> 3.1.0.rc1) was resolved to 3.1.0.rc1, which depends on
    spree_core (= 3.1.0.rc1) was resolved to 3.1.0.rc1, which depends on
      rails (~> 4.2.6) was resolved to 4.2.6, which depends on
        actionpack (= 4.2.6)

附:我可以通过在我的 gemfile 中指定 gem 'rails', '>= 4.2.7' 来解决我的问题。这仍然满足条件 ~> 4.2.6 并且不包含所描述的问题。但我仍然很好奇它是如何描述状态的。

谢谢!

【问题讨论】:

  • 你能粘贴你的GemfileGemfile.lock吗?

标签: ruby-on-rails ruby conflict gemfile


【解决方案1】:

这是因为你使用了不匹配的错误版本的 Rails 和 Spree,所以它们彼此不兼容。

轨道 5:

gem 'spree', '~> 3.2.0'

导轨 4:

gem 'spree', '~> 3.1.0'

【讨论】:

    猜你喜欢
    • 2018-04-01
    • 1970-01-01
    • 2012-07-05
    • 1970-01-01
    • 1970-01-01
    • 2011-03-12
    • 2019-12-24
    • 2021-12-14
    相关资源
    最近更新 更多