aboutsummaryrefslogtreecommitdiffstats
path: root/lib/rubygems
diff options
context:
space:
mode:
authorDavid Rodríguez <deivid.rodriguez@riseup.net>2022-05-25 13:33:20 +0200
committergit <svn-admin@ruby-lang.org>2022-05-28 19:22:15 +0900
commite78c1ddb1ed9b55550c13d0a7f1e84f62f987230 (patch)
treed0ae53c7fb401e63d0d453e08ed0088171d32e8a /lib/rubygems
parent6b0131db6f029f3e472d00deb2134d45ad4dde3a (diff)
downloadruby-e78c1ddb1ed9b55550c13d0a7f1e84f62f987230.tar.gz
[rubygems/rubygems] Fix rubygems update when non default `--install-dir` is configured
https://github.com/rubygems/rubygems/commit/9f3b21192d
Diffstat (limited to 'lib/rubygems')
-rw-r--r--lib/rubygems/commands/update_command.rb9
1 files changed, 4 insertions, 5 deletions
diff --git a/lib/rubygems/commands/update_command.rb b/lib/rubygems/commands/update_command.rb
index 42d6f6046b..54b1251010 100644
--- a/lib/rubygems/commands/update_command.rb
+++ b/lib/rubygems/commands/update_command.rb
@@ -173,10 +173,11 @@ command to remove old versions.
highest_remote_gem.first
end
- def install_rubygems(version) # :nodoc:
+ def install_rubygems(spec) # :nodoc:
args = update_rubygems_arguments
+ version = spec.version
- update_dir = File.join Gem.dir, 'gems', "rubygems-update-#{version}"
+ update_dir = File.join spec.base_dir, 'gems', "rubygems-update-#{version}"
Dir.chdir update_dir do
say "Installing RubyGems #{version}" unless options[:silent]
@@ -290,9 +291,7 @@ command to remove old versions.
installed_gems = update_gem('rubygems-update', version) if installed_gems.empty? || installed_gems.first.version != version
return if installed_gems.empty?
- version = installed_gems.first.version
-
- install_rubygems version
+ install_rubygems installed_gems.first
end
def update_rubygems_arguments # :nodoc: