Reputation: 636
I ran 'gem update' to try to fix a problem in a different app i was working on. Now my main app doesn't work properly because i have a bunch of too-new gems. Is there a way to undo the gem update? Or revert my gems to the versions mentioned in my team's Gemfile.lock file?
Update: It specifically complains about Rake when i try to run 'rake spec'
(Gem::LoadError: You have already activated rake 10.5.0, but your Gemfile requires rake 10.4.2. Prepending bundle exec
to your command may solve this.)
Upvotes: 5
Views: 5326
Reputation: 73
Run 'gem uninstall rake' if you have multiple versions it will ask you which you wish to remove.
Then run 'gem install rake -v 10.4.2' to install the right version.
Worked for me and much less risky than bundle updating everything.
Upvotes: 2
Reputation: 2051
If you currently have a more recent version of a gem than is specified in your Gemfile.lock, then it should suffice to rewrite the Gemfile with the versions mentioned in Gemfile.lock and run a bundle install
.
I tested this locally (downgraded a version in both Gemfile.lock and Gemfile) and bundler installed the old version without problems.
Upvotes: 6