To perform batch operations in MacPorts you can use the predefined pseudo-portnames. RubyGems has no such thing, but instead it can handle regular expressions. So to uninstall all gems of your default RubyGems installation you can simply issue the following command. sudo gem uninstall --a --ignore-dependencies .+ You may have to execute it twice before all gems are gone. If the command doesn’t wor