How to uninstall all ruby gems on windows? How to uninstall all ruby gems on windows? windows windows

How to uninstall all ruby gems on windows?


One line to rule them all. Power shell not needed. From command prompt run:

ruby -e "`gem list`.split(/$/).each { |line| puts `gem uninstall -Iax #{line.split(' ')[0]}` unless line.empty? }"

Just copy / paste and voila!


I've found an elegant solution gem list | %{$_.split(' ')[0]} | %{gem uninstall -Iax $_ } and Windows Powershell


You can delete the contents of your gems folder. Where this is will depend on how you installed Ruby and RubyGems, as well as the Ruby version. For instance, if you used the one-click installer for 1.9.2p180, and installed rubygems with ruby setup.rb, the gems folder would be c:\Ruby192\lib\ruby\gems\ - delete everything under that folder and poof! your gems are gone.