-
Notifications
You must be signed in to change notification settings - Fork 82
Description
Prior to 2017 it was common, and considered best practice, to exclude Gemfile.lock
from version control, but then things changed, and the Bundler team decided, after much discussion, that it is best to commit it for both libraries and apps.
In the official bundler guide to creating a RubyGem, it is in bold, and italic font, that the file is extremely important, and it states that it should always be in version control.
But the previous common practice was very widely known for many years, so it is taking a long time to overturn.

Keeping it in version control does make CI more complex, because many different Rubies cannot share the same Gemfile due to Ruby version contraints of the dependencies resulting in differing installed versions of gems.
With ruby gems (not apps) I use the rubric:
Gemfile is for local development only; never CI
Accounting for this has a side benefit of bringing additional structure and stability to CI. Failures due to changes in dependency resolution become effortlessly apparent.
I would recommend appraisal2 to handle multiple gemfiles, but I am also quite handy at implementing a similar solution without appraisal2 (in fact that is precisely what I did for appraisal2's test suite).