路线5:Bundler找不到宝石“ actionpack”的兼容版本:

dja*_*dam 5 ruby-on-rails

任何人都可以帮助我在运行捆绑更新后将兼容的版本错误升级到Rails 4.2到Rails 5.1.4

Bundler找不到与gem“ actionpack”兼容的版本:在Gemfile中:active_link_to(〜> 1.0.0)已解析为1.0.5,具体取决于actionpack

active_model_serializers (~> 0.10.6) was resolved to 0.10.7, which depends on
  actionpack (< 6, >= 4.1)

hamlit-rails (~> 0.2.0) was resolved to 0.2.0, which depends on
  actionpack (>= 4.0.1)

meta-tags (~> 2.4.1) was resolved to 2.4.1, which depends on
  actionpack (< 5.2, >= 3.2.0)

rails (~> 5.1.4) was resolved to 5.1.4, which depends on
  actionpack (= 5.1.4)

ransack (~> 1.6.6) was resolved to 1.6.6, which depends on
  actionpack (>= 3.0)

rspec-rails (~> 3.4.2) was resolved to 3.4.2, which depends on
  actionpack (< 4.3, >= 3.0)

simple_form (~> 3.5.1) was resolved to 3.5.1, which depends on
  actionpack (< 5.2, > 4)

stream_rails (>= 2.5.2, ~> 2.5) was resolved to 2.6.1, which depends on
  actionpack (>= 3.0.0)

twitter-typeahead-rails (~> 0.10.5) was resolved to 0.10.5, which depends on
  actionpack (>= 3.1)
Run Code Online (Sandbox Code Playgroud)

stw*_*ert 6

您的 rspec-rails 阻止了升级。该打包器输出显示了这一部分:

actionpack (< 4.3, >= 3.0)
Run Code Online (Sandbox Code Playgroud)

因此 rspec-rails 会阻止任何大于 4.2 的内容。

将 rspec-rails 限制释放~> 3.4.2到更轻松的地方,~> 3.5然后再试一次

bundle update rails rspec-rails
Run Code Online (Sandbox Code Playgroud)

一般来说,在升级 Rails 时,请尝试bundle update rails与所有对 Rails 有特定版本要求或 bundler 中提到的 Gems 一起尝试。