Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

Bundler keeps removing 'BUNDLED WITH' section of Gemfile.lock

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.

like image 848
equivalentideas Avatar asked Aug 10 '15 23:08

equivalentideas


People also ask

Should you commit your Gemfile lock?

A: Yes, you should commit it. The presence of a `Gemfile. lock` in a gem's repository ensures that a fresh checkout of the repository uses the exact same set of dependencies every time.

What is 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.

Can I edit Gemfile lock?

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


1 Answers

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)

like image 128
Yoni Avatar answered Oct 03 '22 20:10

Yoni