How can I remove all the gems installed using bundle install
in a particular RoR project. I don't want to uninstall gems that are used by other projects.
Installation and usage To install a prerelease version (if one is available), run gem install bundler --pre . To uninstall Bundler, run gem uninstall bundler .
In the invoked popup, start typing bundler, select bundle install and press Enter . Select Tools | Bundler | Install from the main menu. Open the Gemfile, place the caret at any highlighted gem missing in the project SDK and press Alt+Enter . Select Install missing gems using 'bundler' and press Enter .
Since we're using ruby you could do something like this I guess:
bundle list | ruby -e 'ARGF.readlines[1..-1].each {|l| g = l.split(" "); puts "Removing #{g[1]}"; `gem uninstall --force #{g[1]} -v #{g[2].gsub(/\(|\)/, "")}`; }'
NOTE: Only lightly tested.
If you love us? You can donate to us via Paypal or buy me a coffee so we can maintain and grow! Thank you!
Donate Us With