Ruby on rails 从2.3切换到2.4时出现捆绑更新错误

Ruby on rails 从2.3切换到2.4时出现捆绑更新错误,ruby-on-rails,bundler,rbenv,gemfile,Ruby On Rails,Bundler,Rbenv,Gemfile,我正在尝试从Ruby 2.3迁移到2.4.2,并从monogID 5.0迁移到5.2 我收到一个包更新错误 我正在使用rbenv,并在本地安装和设置了2.4.2 然后我不得不运行gem安装bundler->it安装了2.0.1 然后我运行了bundle更新,得到了这个错误 Bundler could not find compatible versions for gem "bundler": In Gemfile: iron_worker_ng was reso

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

我收到一个包更新错误

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

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

然后我运行了bundle更新,得到了这个错误

      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
Bundler找不到gem“Bundler”的兼容版本:
在文件中:
钢铁工人ng被分解为1.6.10,这取决于
捆扎机
rails(~>4.2)已解析为4.2.11,这取决于
捆扎机(<2.0,>=1.3.0)
当前绑定程序版本:
捆扎机(2.0.1)
此文件需要不同版本的Bundler。
也许您需要通过运行“gem安装Bundler”来更新Bundler?
找不到gem'rails所需的gem'bundler(<2.0,>=1.3.0)”
(~>4.2)”,在任何来源中。
Bundler找不到gem“mongoid”的兼容版本:
在文件中:
mongoid(~>5.2)
mongoid加密字段已解析为1.2.2,这取决于
蒙哥德

我不知道如何修复此问题?

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

gem install bundler -v '~> 1.17'
rails(~>4.2)已解析为4.2.11,这取决于
捆扎机(<2.0,>=1.3.0)

看起来您正在使用rails 4.2,它需要旧版本的bundler

gem install bundler -v '~> 1.17'
然后跑

bundle install
您还需要解决一些其他依赖项