Bundler 找不到 gem 的兼容版本。版本在范围内

Bundler could not find compatible versions for gem. The version is within range

Bundler 在我 运行 bundle install 时出现此错误,但 actionmailer 5.2.6 在 >= 5.2 和 < 8 的范围内!为什么会报错?它正在为多个宝石执行此操作。依赖性在所有这些范围内。

Bundler could not find compatible versions for gem "actionmailer":
  In Gemfile:
    exception_notification (~> 4.2) was resolved to 4.5.0, which depends on
      actionmailer (< 8, >= 5.2)

    rails (~> 5.2.6) was resolved to 5.2.6, which depends on
      actionmailer (= 5.2.6)

这是另一个无意义错误的示例。显然 5.0 <= 5.2.6 < 7:

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

    rails_admin (~> 2.0.1) was resolved to 2.0.2, which depends on
      rails (>= 5.0, < 7)

我删除了Gemfile.lock。捆绑器版本 2.3.9。 Gemfile

是因为这一行:

gem 'flip', '~>1.1', :git => 'https://github.com/pda/flip.git'

评论时,它有效。取消注释时,它会吐出无意义的错误并隐藏在错误中:

Bundler could not find compatible versions for gem "activesupport":
  In Gemfile:
    flip (~> 1.1) was resolved to 1.1.1, which depends on
      activesupport (>= 4.0, <= 5.2)

    rails (~> 5.2.6) was resolved to 5.2.6, which depends on
      activesupport (= 5.2.6)

我认为这是它应该打印出来的唯一错误,但这可能是 Bundler 中的错误。现在我必须手动实现 Gem 或考虑一个猴子补丁。 (我不喜欢不必要的和肤浅的依赖。)