Skip to content
class method

Gem::Uninstaller.new

() -> ::Gem::Uninstaller
new(gem, options = {})

Constructs an uninstaller that will uninstall gem named gem. options is a Hash with the following keys:

:version

Version requirement for the gem to uninstall. If not specified, uses Gem::Requirement.default.

:install_dir

The directory where the gem is installed. If not specified, uses Gem.dir.

:executables

Whether executables should be removed without confirmation or not. If nil, asks the user explicitly.

:all

If more than one version matches the requirement, whether to forcefully remove all matching versions or ask the user to select specific matching versions that should be removed.

:ignore

Ignore broken dependency checks when uninstalling.

:bin_dir

Directory containing executables to remove. If not specified, uses Gem.bindir.

:format_executable

In order to find executables to be removed, format executable names using Gem::Installer.exec_format.

:abort_on_dependent

Directly abort uninstallation if dependencies would be broken, rather than asking the user for confirmation.

:check_dev

When checking if uninstalling gem would leave broken dependencies around, also consider development dependencies.

:force

Set both :all and :ignore to true for forced uninstallation.

:user_install

Uninstall from user gem directory instead of system directory.

See also #announce_deletion_of #default_spec_matches? also in 4.1 · 3.4 · 3.3 · 3.2 · 3.1 · 3.0