Bundler so far ignored the version specified under BUNDLED_WITH
in the Gemfile.lock
. This had two annoying consequences:
Gemfile.lock
, you got an error message and had to manually install the correct version.Gemfile.lock
, bundler silently updated the version in the Gemfile.lock
to your system's bundler version. To avoid this, you had to always specify, which version you want to use for each bundler command, e.g. bundler _2.1.4_ update
New behavior
Bundler now honors the version specified under
BUNDLED_WITH
in theGemfile.lock
. The necessary version will automatically be installed, if missing.
This requires bundler 2.3 and rubygems 3.3
For more details, see: https://bundler.io/blog/2022/01/23/bundler-v2-3.html Show archive.org snapshot
Determine your currently used bundler version:
bundler -v
Caution: this might already be influenced by a Gemfile.lock
in your current directory. Run this command in two projects with different bundler versions in their Gemfile.lock
and see if your bundler versions changes automatically. Then you probably already have the new versions.
Install a new bundler version:
# specific version
gem install bundler:2.3.11
# newest version
gem install bundler
I recommend to execute the previous command in the parent folder of all your git repos.
Determine the installed version:
gem --version
Update your rubygems version
gem update --system
With the new behavior bundler should never update its version in a Gemfile.lock
automatically anymore. Therefore, unless there are reasons for using an older version, it is recommended to upgrade the bundler version for each project manually every once in a while. Good occasions would be the start and end of a development block.
Update the bundler version under BUNDLED_WITH
in the Gemfile.lock
:
bundle update --bundler