summaryrefslogtreecommitdiff
path: root/lib
diff options
context:
space:
mode:
authorCamden Narzt <6243207+CamJN@users.noreply.github.com>2024-12-11 12:29:39 -0700
committergit <svn-admin@ruby-lang.org>2024-12-13 14:23:30 +0000
commit6cde41bc52cb411a3259349b23fab2cd05789b01 (patch)
tree2ec7d79ff2e2efbda1730ba49398d96bb4a8e48b /lib
parent3cb79d408253cd4f60c2bd0a69ceedfc424b63e8 (diff)
[rubygems/rubygems] Fix restarting with locked version when $PROGRAM_NAME has been changed
Use Process.argv0 instead of $PROGRAM_NAME because $PROGRAM_NAME is liable to be changed but Process.argv0 is not. https://github.com/rubygems/rubygems/commit/43b747dc9e
Diffstat (limited to 'lib')
-rw-r--r--lib/bundler/self_manager.rb4
1 files changed, 2 insertions, 2 deletions
diff --git a/lib/bundler/self_manager.rb b/lib/bundler/self_manager.rb
index 6ab41b99f7..b88faf7589 100644
--- a/lib/bundler/self_manager.rb
+++ b/lib/bundler/self_manager.rb
@@ -84,8 +84,8 @@ module Bundler
require "shellwords"
cmd = [*Shellwords.shellsplit(bundler_spec_original_cmd), *ARGV]
else
- cmd = [$PROGRAM_NAME, *ARGV]
- cmd.unshift(Gem.ruby) unless File.executable?($PROGRAM_NAME)
+ cmd = [Process.argv0, *ARGV]
+ cmd.unshift(Gem.ruby) unless File.executable?(Process.argv0)
end
Bundler.with_original_env do