aboutsummaryrefslogtreecommitdiffstats
path: root/lib/rubygems/commands/uninstall_command.rb
diff options
context:
space:
mode:
Diffstat (limited to 'lib/rubygems/commands/uninstall_command.rb')
-rw-r--r--lib/rubygems/commands/uninstall_command.rb13
1 files changed, 12 insertions, 1 deletions
diff --git a/lib/rubygems/commands/uninstall_command.rb b/lib/rubygems/commands/uninstall_command.rb
index 2d9c46ee52..3d6e2383bc 100644
--- a/lib/rubygems/commands/uninstall_command.rb
+++ b/lib/rubygems/commands/uninstall_command.rb
@@ -35,6 +35,11 @@ module Gem
options[:install_dir] = File.expand_path(value)
end
+ add_option('-n', '--bindir DIR',
+ 'Directory to remove binaries from') do |value, options|
+ options[:bin_dir] = File.expand_path(value)
+ end
+
add_version_option
add_platform_option
end
@@ -54,7 +59,13 @@ module Gem
def execute
get_all_gem_names.each do |gem_name|
- Gem::Uninstaller.new(gem_name, options).uninstall
+ begin
+ Gem::Uninstaller.new(gem_name, options).uninstall
+ rescue Gem::GemNotInHomeException => e
+ spec = e.spec
+ alert("In order to remove #{spec.name}, please execute:\n" \
+ "\tgem uninstall #{spec.name} --install-dir=#{spec.installation_path}")
+ end
end
end
end