Bundler always adds "BUNDLED WITH" to Gemfile.lock

(Gerhard Schlager) #1

I just installed a new development environment with the current version of bundler (1.10.1).
When I run bundle install it always changes the Gemfile.lock and adds the following:


That’s quite annoying since git always sees a changed file.

Should I revert back to bundler 1.9?
Is there some config option to disable this behavior (I couldn’t find one)?
Or can we do something within the Gemfile in order to stop this from happening?

Bundler version warning while updating
(Sam Saffron) #2

nahh, we should get this sorted, will ask Andre what the correct course of action is.

(André Arko) #3

Is there something stopping you from checking in the new lock file?

We need to start tracking the version of Bundler so that when breaking changes are made in e.g. 2.0, Bundler 1.x will know to not try to install.

(Sam Saffron) #4

nope, nothing as long as the old version does not revert that change in. I guess we can force all devs onto latest bundler.

(André Arko) #5

Bundler versions 1.10 and up will all create that section if it does not exist, but they will not ever lower the version number recorded—it’s simply a record of the newest version of Bundler that has ever installed this gemfile and checked in the lock. Bundler will use that to print a warning if you’re using a version older than the version that created and checked in the lock, but otherwise nothing will happen.

(Simon Cossar) #6

How do I update to the latest bundler? I am using the Discourse vagrant image for development?

(Régis Hanol) #7

gem update bundler :wink:

(Simon Cossar) #8

Do I run this on my local machine, or inside of the vagrant box? I had assumed that the version of bundler was set by the vagrant image.

(Sam Saffron) #9

Run it on both :slight_smile: nothing to lose really

(Simon Cossar) #10

Yes, but unless I am misunderstanding how vagrant/VirtualBox works, there is nothing to gain from running it on my local machine. Running it inside of the vagrant image returns this:

[vagrant@precise32:/vagrant (vertically-align-category-badge)]$ gem update bundler
Updating installed gems
Updating bundler
ERROR:  While executing gem ... (Gem::FilePermissionError)
    You don't have write permissions for the /var/lib/gems/2.2.0 directory.

(Sam Saffron) #11

run it as sudo, I am not sure but it seems like vagrant is using system ruby.

(Mittineague) #12

I’ve had to reinstall bundler a couple of times (mea culpa)
vagrant up; vagrant ssh
worked for me

(Simon Cossar) #13

Running the command as sudo inside of the vagrant box did the trick. Vagrant is not using the system ruby.