我是Ruby和Rails的新手,我正在尝试遵循Spree的指令,但在执行bundle install
时我遇到了依赖解析的问题。我搜索了一堆类似的问题,但在所有这些问题中,gemfile中有几个“root”宝石。就我而言,我只有单根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)
P.S。我能够通过在gemfile中指定gem 'rails', '>= 4.2.7'
来解决我的问题。这仍然满足条件〜> 4.2.6并不包含所述问题。但我仍然很好奇它是如何形容状态的。
谢谢!
答案 0 :(得分:0)
这是因为您使用的Rails和Spree的错误版本不匹配,因此它们彼此不兼容。
Rails 5:
gem 'spree', '~> 3.2.0'
Rails 4:
gem 'spree', '~> 3.1.0'