Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

How to stop rails from adding BUNDLED WITH to the Gemfile.lock

I'm working with a distributed team of developers and I'm getting this issue of having to commit the Gemfile.lock with bundled with info added to the bottom:

BUNDLED WITH 1.10.2

We're obviously using different versions of things, ie rvm/rbenv, and I'm wondering if there's a way to stop my system doing this.

Bundler version 1.10.2 (obviously)

like image 539
tmartin314 Avatar asked Jun 08 '15 15:06

tmartin314


People also ask

Is Gemfile lock automatically generated?

Gemfile. lock is automatically generated when you run bundle install or bundle update . It should never be edited manually.

What is the difference between Gemfile and Gemfile lock?

The Gemfile is where you specify which gems you want to use, and lets you specify which versions. The Gemfile. lock file is where Bundler records the exact versions that were installed. This way, when the same library/project is loaded on another machine, running bundle install will look at the Gemfile.

Why do we need Gemfile lock?

The Gemfile. lock allows you to specify the versions of the dependencies that your application needs in the Gemfile , while remembering all of the exact versions of third-party code that your application used when it last worked correctly. By specifying looser dependencies in your Gemfile (such as nokogiri ~> 1.4.

Should you commit your Gemfile lock?

You should always include your Gemfile. lock if you are writing an application. The community seems to (largely) agree that you should include it in any Gems you create as well.


1 Answers

After digging around a bit, and looking through those issues and comments shared by Jorge, you really only have two options:

  1. Downgrade your version of bundler to something earlier than 1.10
  2. Ask your whole team to update their versions of bundler to something later than 1.10

    gem uninstall bundler

    gem install bundler -v 1.9.9

But as long as the downgrade doesn't cause any issues, it should be fine.

The developers for the bundler gem are not going to make any changes to the gem that will eliminate this problem. They're reasoning is that eventually everyone will be upgraded to something after 1.10.

like image 126
tmartin314 Avatar answered Sep 19 '22 18:09

tmartin314