There are instances where I would like to revert and uninstall all previous gem installations.
For instance, I needed to assist a friend migrate their rails developm
If you like doing it using ruby:
ruby -e "`gem list`.split(/$/).each { |line| puts `gem uninstall -Iax #{line.split(' ')[0]}` unless line.strip.empty? }"
Cheers