uninstall a gem code example

Example: ruby gem uninstall

The command is simply: gem uninstall <gem-name>
# for a general uninstall

NOTE: maybe you need sudo, depens on your user rights. like so

  sudo gem uninstall <gem-name>

# remove all old versions of the gem
gem cleanup <gem-name>

# choose which ones you want to remove
gem uninstall <gem-name>

# remove version 1.1.9 only
gem uninstall <gem-name> --version 1.1.9

# remove all versions less than 1.3.4
gem uninstall <gem-name> --version '<1.3.4'

# remove ALL INSTALLED Gems (and starting over)
gem uninstall -aIx

  Options
  -a, --[no-]all                   Uninstall all matching versions
  -I, --[no-]ignore-dependencies   Ignore dependency requirements while
                                 uninstalling
  -x, --[no-]executables           Uninstall applicable executables without
                                 confirmation

Tags:

Ruby Example