Skip to content

Instantly share code, notes, and snippets.

@cowboy-cod3r
Created November 25, 2013 17:01
Show Gist options
  • Save cowboy-cod3r/7644632 to your computer and use it in GitHub Desktop.
Save cowboy-cod3r/7644632 to your computer and use it in GitHub Desktop.
Ruby: Uninstall a List of Gems
# Get a list of gems
for i in $(/opt/apps/ruby/ruby/bin/gem list --no-versions);
do
# If list the gem starts with 'ivv'
if [[ "$i" == ivv* ]];then
# Uninstall the gem
# -x : removes executables
# -I : ignores dependencies
# -a : removes all versions
/opt/apps/ruby/ruby/bin/gem uninstall $i -x -I -a
fi
done
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment