Rails中的语义版本控制:是6.1.0.alpha,大于5.2

时间:2019-04-24 21:13:34

标签: ruby-on-rails semantic-versioning

这是什么问题? 6.1.0.alpha大于5.2,所以我不知道为什么我的bundle / build在travis ci上失败。

Bundler could not find compatible versions for gem "activemodel":
  In Gemfile:
    rails was resolved to 6.1.0.alpha, which depends on
      activemodel (= 6.1.0.alpha)
    web-console was resolved to 3.7.0, which depends on
      activemodel (>= 5.2)

1 个答案:

答案 0 :(得分:0)

您可以像这样检查它:

Gem::Version.new('6.1.0.alpha') >= Gem::Version.new('5.2') # => true
Gem::Requirement.new(">= 5.2").satisfied_by?(Gem::Version.new('6.1.0.alpha')) # => true

Bundler倾向于输出无法匹配其版本的宝石的所有版本要求,即使是那些满足要求的宝石,也很可能还有另一个具有不匹配要求的宝石。