I installed all of my gems using bundler via the Gemfile. I thought (mistakenly) that if I deleted a gem from my Gemfile and ran \'bundle install\' that the deleted gems would b
With newer versions of bundler you can use the clean task:
$ bundle help clean
Usage:
bundle clean
Options:
[--dry-run=only print out changes, do not actually clean gems]
[--force=forces clean even if --path is not set]
[--no-color=Disable colorization in output]
-V, [--verbose=Enable verbose output mode]
Cleans up unused gems in your bundler directory
$ bundle clean --dry-run --force
Would have removed actionmailer (3.1.12)
Would have removed actionmailer (3.2.0.rc2)
Would have removed actionpack (3.1.12)
Would have removed actionpack (3.2.0.rc2)
Would have removed activemodel (3.1.12)
...
edit:
This is not recommended if you're using a global gemset (i.e. - all of your projects keep their gems in the same place). There're few ways to keep each project's gems separate, though:
rvm
gemsets (http://rvm.io/gemsets/basics)bundle install
with any of the following options: --deployment
or --path=
(http://bundler.io/v1.3/man/bundle-install.1.html)