首页 文章

RAILS 5:Bundler找不到gem“actionpack”的兼容版本:

提问于
浏览
2

任何人都可以帮助我将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)

2 回答

  • 1

    删除你的Gemfile.lock并将其添加到你的Gemfile:

    来源'https://rubygems.org'

    并且别忘了更新你的其他宝石

  • 1

    你的rspec-rails会阻止升级 . 捆绑器输出显示了这一部分:

    actionpack (< 4.3, >= 3.0)
    

    所以rspec-rails会阻止任何大于4.2的东西 .

    将rspec-rails禁令 ~> 3.4.2 释放到更轻松的状态,如 ~> 3.5 ,然后再试一次

    bundle update rails rspec-rails
    

    通常,在升级Rails时,请尝试 bundle update rails 以及所有对Rails具有特定版本要求或从bundler中提及的Gems .

相关问题