10

My machine is running bundler 1.10.6. When I run bundle install, the BUNDLED WITH block is removed from my Gemfile.lock.

BUNDLED WITH
    1.10.5

If I run git checkout -- Gemfile.lock, it doesn't revert the change. This is a problem because it means I can't get a clear working HEAD so I can't rebase, cherry-pick or run other important git commands.

I understand why bundler usually updates this section of the Gemfile.lock to log the bundler version, but why would it be removing the section?

You can read more about the BUNDLED WITH section at the bundler blog.

equivalentideas
  • 325
  • 3
  • 15
  • So, you said you have `1.10.6` in your machine but your `BUNDLED_WITH` is showing `1.10.5`! – K M Rakibul Islam Aug 11 '15 at 00:54
  • can you try: `bundler -v` and `bundle exec bundler -v` and show me the output? – K M Rakibul Islam Aug 11 '15 at 00:58
  • 1
    Recently I faced similar problem with Gemfile.lock. The problem may be with line ending. [This answer](http://stackoverflow.com/questions/2016404/git-status-shows-modifications-git-checkout-file-doesnt-remove-them) helped me. Try `git rm Gemfile.lock && git checkout -- Gemfile.lock` if you need to do something urgent – Nick Roz Sep 17 '15 at 11:27

1 Answers1

5

All you need to do to is to upgrade the "bundler" gem (something that is also recommended)- Simply run: gem update bundler This would work for most people.

Also, try: gem update rubygems-bundler in case that comes from a rubygems issue (which was resolved)

Yoni
  • 624
  • 5
  • 15
  • hmm, that's what I thought, but in practice I'm finding different. With bundler 1.11.2, a Gemfile.lock that says BUNDLED WITH 1.11.2, same ruby and rvm 1.26.11, and the repo deployed on two identical centos servers .. `bundle install` removes the BUNDLED WITH on one machine, but leaves it in place on the other. go figure! – tardate Dec 22 '15 at 07:14
  • 1
    it seems my issue was caused by `rubygems-bundler` also needing an update (to 1.4.4), see https://github.com/bundler/bundler/issues/4180 – tardate Dec 22 '15 at 08:46