Uninstalling and reinstalling all ruby gems

sudo gem list | cut -d" " -f1 > gem_list.txt
cat gem_list.txt | xargs sudo gem uninstall -aIx
cat gem_list.txt | xargs sudo gem install

This is useful if you ever want to just reset your gems and clean them up. Or if you upgrade to Snow Leopard and want to make sure all your native gems are in decent shape (since Snow Leopard is 64-bit).

5 responses
Wish I had seen this before I wiped my snow-leopard install... http://bit.ly/4DRa0V
Useless use of cat detected ;)
3 visitors upvoted this post.