Uninstalling all RubyGems

I was trying to clean up my Mac, this is when I wanted to uninstall all the Gems I installed on my system, removing them manually was a pain as some of them were dependencies and there were ways to many of them, so I discovered this way of removing all the RubyGems.

for i in `gem list --no-versions`; do sudo gem uninstall -aIx $i; done  

Leave a comment below, if you have a better way to do this.