DEV Community

wusher
wusher

Posted on • Originally published at wusher.github.io on

Uninstall All Bundled Gems

I came across a quick way to delete all the gems installed through bundler. source

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(/\(|\)/, "")}`; }'

Enter fullscreen mode Exit fullscreen mode

Line by line version

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(/\(|\)/, "")}`
}'

Enter fullscreen mode Exit fullscreen mode

Top comments (0)

Postmark Image

Speedy emails, satisfied customers

Are delayed transactional emails costing you user satisfaction? Postmark delivers your emails almost instantly, keeping your customers happy and connected.

Sign up