【问题标题】:Bundle update error when switching from 2.3 to 2.4从 2.3 切换到 2.4 时出现包更新错误
【发布时间】:2019-02-20 05:59:02
【问题描述】:

我正在尝试从 Ruby 2.3 迁移到 2.4.2 和 monogID 5.0 到 5.2

我收到包更新错误。

我正在使用 rbenv 并在本地安装和设置 2.4.2。

然后我不得不运行 gem install bundler -> 它安装了 2.0.1

然后我运行包更新并收到此错误。

      Bundler could not find compatible versions for gem "bundler":
    In Gemfile:
      iron_worker_ng was resolved to 1.6.10, which depends on
        bundler

      rails (~> 4.2) was resolved to 4.2.11, which depends on
        bundler (< 2.0, >= 1.3.0)

    Current Bundler version:
      bundler (2.0.1)
  This Gemfile requires a different version of Bundler.
  Perhaps you need to update Bundler by running `gem install bundler`?

  Could not find gem 'bundler (< 2.0, >= 1.3.0)', which is required by gem 'rails
  (~> 4.2)', in any of the sources.

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

      mongoid-encrypted-fields was resolved to 1.2.2, which depends on
        mongoid

我不知道如何解决这个问题?

【问题讨论】:

    标签: ruby-on-rails bundler rbenv gemfile


    【解决方案1】:

    您需要做的第一件事是安装兼容版本的捆绑器

    gem install bundler -v '~> 1.17'
    

    rails (~> 4.2) 被解析为 4.2.11,这取决于
    捆绑器 (= 1.3.0)

    好像您使用的是 Rails 4.2,它需要旧版本的 bundler

    然后运行

    bundle install
    

    你还需要解决一些其他的依赖关系

    【讨论】:

      猜你喜欢
      • 2015-10-05
      • 1970-01-01
      • 1970-01-01
      • 2017-08-10
      • 1970-01-01
      • 2011-01-18
      • 1970-01-01
      • 2021-09-29
      • 1970-01-01
      相关资源
      最近更新 更多