how to undo bundle update
Ruby on-RailsRvmBundlerRuby 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.