Gemfile.lock generates BUNDLED WITH

6.1k views Asked by At

I have been googling around about this, seems I couldn't find a solution regarding this issue. So here is a thing, I am currently working rails project with my colleague, it was working fine till she changed her laptop and re-setup her environment from scratch...

Whenever she changes something on the project, the Gemfile.lock always writes this at the end of the file:

BUNDLED WITH
1.10.0.rc

And every time she accidentally commits this Gemfile.lock, it gets really troublesome for other devs to work because it always gives a message that we need to commit/clash something because on our environment, it automatically remove it

2

There are 2 answers

2
Maysam Torabi On BEST ANSWER

Either she has to downgrade her bundler or the rest of the team should upgrade their bundler, I would recommend the later of course

gem update bundler
0
docwhat On

As of Bundler 2.3, Bundler will attempt to fetch the correct version of Bundler.

From https://bundler.io/blog/2022/01/23/bundler-v2-3.html

In Bundler 2.3 and up (if you also have RubyGems 3.3 or higher), running bundle install will use the exact version from the BUNDLED WITH section of the lockfile. If that version is not installed before you run bundle install, the running version of Bundler will install the locked version, and then run your original command using the newly-installed locked version.

This would solve your problem, if you still have it. :-)