6cfsbg
Last Updated: February 25, 2016
·
2.474K
· mrako
4fe949ea9ee7c0bc5eb4bf3e17b09d75

Clean your Bundles

Are you using RVM and Bundler?

You might be aware that once change your Gemfile and re-run bundle or bundle install, the old gems in the gemset will not be deleted.

Usually this does not matter as your execution is using the latest versions of your gems. However if you end up downgrading your gems your project might accidentally use wrong dependencies.

Then you should clean your gemset using bundler:

$ bundle clean --force

Example

You have tried to upgrade to Rails 3.2.11, but your has_many <dependency> does not yet inclue inverse_of:. Now your specs fail.

As you revert back to e.g. Rails 3.2.8, your activesupport 3.2.11 will not be updated, and your specs will still fail (unless you strictly use bundle exec <command>). After running bundle clean --force, if your gemset has been correctly set, you don't need bundle exec and all will work as expected.

Say Thanks
Respond