首页 > 解决方案 > 警告:Bundler 的运行版本比创建锁文件错误的版本旧

问题描述

当我开发/测试时,我的控制台中不断出现此错误

Warning: the running version of Bundler (2.1.2) is older than the version that created the lockfile (2.1.4). We suggest you to upgrade to the version that created the lockfile by running `gem install bundler:2.1.4`.

它根本没有阻止我,而是困扰着我。我知道最简单的解决方案就是将我的 Gemfile.lock 更新为此。

BUNDLED WITH
   2.1.2

但我想永久解决这个问题。我试着

gem uninstall bundler

进而

gem install bundler -v 2.1.4

它让我一直给出这个错误

Gem bundler-2.1.2 cannot be uninstalled because it is a default gem

当我尝试先安装 2.1.4 然后删除 bundler 2.1.2 时,控制台给了我这个输出。

Gem bundler-2.1.2 cannot be uninstalled because it is a default gem
Successfully uninstalled bundler-2.1.4

这个问题有什么解决办法吗?提前致谢

标签: ruby-on-railsbundlerruby-on-rails-6

解决方案


根据 Anne van Rossum,gem update --system 为我解决了这个问题。


推荐阅读