如何更改 Rails 依赖项?

How to change Rails dependencies?

最近我从 Github

得到了 the alert

我想按照规定更新 actionview,但在 运行 bundle update actionview 之后我得到:

Bundler could not find compatible versions for gem "actionview":
In Gemfile:
actionview (>= 6.0.2.2)

rails (>= 6.0.2.1) was resolved to 6.0.2.1, which depends on
  actionview (= 6.0.2.1)

问题是 Rails 没有(或没有(?))使用 Gemfile 来管理 gems,所以我无法修复那个锁。请帮忙!

如果您的 Gemfile 还包含 rails,那么 actionview 将受此限制,如捆绑程序 (actionview (= 6.0.2.1)) 的输出所示。这表明您当前的 rails 版本将只接受 actionview6.0.2.1 版本。

actionviewrails 的依赖项之一。参见 https://github.com/rails/rails/blob/v6.0.2.2/rails.gemspec#L33

您还可以看到版本同步提升。因此,为了在 Gemfile 中使用 rails 提高 actionview 的版本,您可以 运行 bundle update rails 或查看仅包含 actionview 的选项Gemfile,但不是 rails。对于后一种情况,您应该能够重新 运行 bundle update actionview 来更新 actionview.