how to undo bundle update

Ruby on-RailsRvmBundler

Ruby on-Rails Problem Overview


bundle update and bundle install is ver fantastic. However, is there a good way to undo bundle install and bundle update if something went wrong ?

Ruby on-Rails Solutions


Solution 1 - Ruby on-Rails

There is one obvious way:

git checkout -- Gemfile.lock

and then run

bundle install

It assumes you use git - but who does not now days, I have everything in git.

Solution 2 - Ruby on-Rails

I went into Github, copied my old Gemfile.lock that I wanted and pasted it into my Gemfile.lock in my code and then ran bundle install.

Solution 3 - Ruby on-Rails

I tried to follow the accepted answer but I was still getting errors. This is what worked for me:

git checkout -- Gemfile.lock

And then:

bundle pristine

As described in the Bundler docs, bundle pristine restores installed gems to their pristine condition.

Attributions

All content for this solution is sourced from the original question on Stackoverflow.

The content on this page is licensed under the Attribution-ShareAlike 4.0 International (CC BY-SA 4.0) license.

Content TypeOriginal AuthorOriginal Content on Stackoverflow
Questionhey mikeView Question on Stackoverflow
Solution 1 - Ruby on-RailsmpapisView Answer on Stackoverflow
Solution 2 - Ruby on-Railsdgreen22View Answer on Stackoverflow
Solution 3 - Ruby on-RailsFlavioEscobarView Answer on Stackoverflow