LoginSignup
11
11

More than 5 years have passed since last update.

gemをすべてアンインストールするワンライナー

Last updated at Posted at 2012-12-26

rvmでは以前のでうまくいったけど、rbenvでうまくいかなかったので改良しました。

gem_uninstall_all
#!/usr/bin/env ruby

gem_list = `gem list --no-version`
gem_list.each_line do |line|
  next if line.empty? || /LOCAL GEMS/ =~ line
  system "gem uninstall -axI #{line}"
end
11
11
0

Register as a new user and use Qiita more conveniently

  1. You get articles that match your needs
  2. You can efficiently read back useful information
  3. You can use dark theme
What you can do with signing up
11
11