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)

A Workflow Copilot. Tailored to You.

Pieces.app image

Our desktop app, with its intelligent copilot, streamlines coding by generating snippets, extracting code from screenshots, and accelerating problem-solving.

Read the docs

👋 Kindness is contagious

Please leave a ❤️ or a friendly comment on this post if you found it helpful!

Okay