【问题标题】:During Ruby and Rails upgrade Bundler showing dependency error在 Ruby 和 Rails 升级期间 Bundler 显示依赖错误
【发布时间】:2021-07-05 05:09:27
【问题描述】:

请帮帮我,我正在升级 ruby​​ 和 rails,依赖的 gems 也需要升级。

早期的 ruby​​ 版本是 2.3.0,rails 是 4.2.x,现在升级到 2.6.0,rails 到 6.0.4

如果你看到下面的错误,actionpack 被解析为 6.0.4 并且 public_activity 也需要 actionpack >=3.0.0,这意味着 6.0.4 应该是可以接受的,并且显然使用 version = 6.0.4,那么为什么它是一个错误。有高手能介绍一下吗?

Bundler could not find compatible versions for gem "actionpack":
  In Gemfile:
    actionpack (~> 6.0, >= 6.0.4)

    public_activity (~> 1.6, >= 1.6.4) was resolved to 1.6.4, which depends on
      actionpack (>= 3.0.0)

    rails (= 6.0.4) was resolved to 6.0.4, which depends on
      actionpack (= 6.0.4)

Bundler could not find compatible versions for gem "activemodel":
  In Gemfile:
    activemodel (~> 6.0, >= 6.0.4)

    active_model_otp was resolved to 1.2.0, which depends on
      activemodel

    paperclip (~> 6.1) was resolved to 6.1.0, which depends on
      activemodel (>= 4.2.0)

    rails (= 6.0.4) was resolved to 6.0.4, which depends on
      activemodel (= 6.0.4)

Bundler could not find compatible versions for gem "activesupport":
  In Gemfile:
    activesupport (~> 6.0, >= 6.0.4)

    delayed_job (~> 4.1, >= 4.1.9) was resolved to 4.1.9, which depends on
      activesupport (>= 3.0, < 6.2)

    factory_girl_rails (= 4.2.1) was resolved to 4.2.1, which depends on
      factory_girl (~> 4.2.0) was resolved to 4.2.0, which depends on
        activesupport (>= 3.0.0)

    jbuilder (~> 2.10) was resolved to 2.11.2, which depends on
      activesupport (>= 5.0.0)

    paperclip (~> 6.1) was resolved to 6.1.0, which depends on
      activesupport (>= 4.2.0)

    rails (= 6.0.4) was resolved to 6.0.4, which depends on
      activesupport (= 6.0.4)

Bundler could not find compatible versions for gem "capybara":
  In Gemfile:
    capybara (= 2.1.0)

    cucumber-rails (= 1.4.0) was resolved to 1.4.0, which depends on
      capybara (>= 1.1.2)

Bundler could not find compatible versions for gem "rack":
  In Gemfile:
    rails (= 6.0.4) was resolved to 6.0.4, which depends on
      actionpack (= 6.0.4) was resolved to 6.0.4, which depends on
        rack (~> 2.0, >= 2.0.8)

    sprockets (= 2.11.0) was resolved to 2.11.0, which depends on
      rack (~> 1.0)

Bundler could not find compatible versions for gem "rails":
  In Gemfile:
    rails (= 6.0.4)

    cucumber-rails (= 1.4.0) was resolved to 1.4.0, which depends on
      rails (>= 3.0.0)

Bundler could not find compatible versions for gem "railties":
  In Gemfile:
    coffee-rails (~> 5.0) was resolved to 5.0.0, which depends on
      railties (>= 5.2.0)

    devise was resolved to 4.8.0, which depends on
      railties (>= 4.1)

    doorkeeper (= 4.2.5) was resolved to 4.2.5, which depends on
      railties (>= 4.2)

    factory_girl_rails (= 4.2.1) was resolved to 4.2.1, which depends on
      railties (>= 3.0.0)

    rails (= 6.0.4) was resolved to 6.0.4, which depends on
      railties (= 6.0.4)

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

    active_model_otp was resolved to 1.2.0, which depends on
      rotp

Bundler could not find compatible versions for gem "will_paginate":
  In Gemfile:
    will_paginate (= 3.0.5)

    bootstrap-will_paginate (= 0.0.10) was resolved to 0.0.10, which depends on
      will_paginate


【问题讨论】:

    标签: ruby-on-rails rubygems bundler major-upgrade


    【解决方案1】:

    我正在回答我自己的问题,因为它经过多次迭代得到解决。

    我把Gemfile.lock去掉了,在Gemfile中开始一一进入Gems,然后每次都运行bundle install,最终没有出现这个问题。

    【讨论】:

      猜你喜欢
      • 1970-01-01
      • 1970-01-01
      • 1970-01-01
      • 1970-01-01
      • 2020-01-07
      • 1970-01-01
      • 2020-05-02
      • 1970-01-01
      • 1970-01-01
      相关资源
      最近更新 更多