summaryrefslogtreecommitdiff
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.rb4
1 files changed, 4 insertions, 0 deletions
diff --git a/lib/rubygems/commands/uninstall_command.rb b/lib/rubygems/commands/uninstall_command.rb
index 61e55f196e..67a3d38bba 100644
--- a/lib/rubygems/commands/uninstall_command.rb
+++ b/lib/rubygems/commands/uninstall_command.rb
@@ -73,6 +73,8 @@ class Gem::Commands::UninstallCommand < Gem::Command
end
def execute
+ original_path = Gem.path
+
get_all_gem_names.each do |gem_name|
begin
Gem::Uninstaller.new(gem_name, options).uninstall
@@ -80,6 +82,8 @@ class Gem::Commands::UninstallCommand < Gem::Command
spec = e.spec
alert("In order to remove #{spec.name}, please execute:\n" \
"\tgem uninstall #{spec.name} --install-dir=#{spec.installation_path}")
+ ensure
+ Gem.use_paths(*original_path)
end
end
end