summaryrefslogtreecommitdiff
path: root/lib
diff options
context:
space:
mode:
authorDavid Rodríguez <deivid.rodriguez@riseup.net>2024-07-18 20:17:55 +0200
committergit <svn-admin@ruby-lang.org>2024-10-30 19:38:08 +0000
commit5da1cc6c9c548bf95599ad7aa1b3877f8ccda953 (patch)
treee5a686ff7e2c515d0b71d65d5d729abfe3e72cd0 /lib
parent116d6cbc834c5c58a414d94f93f54e1007c0b60b (diff)
[rubygems/rubygems] Rely on PATH if Ruby is not installed in the same directory as the binstub
https://github.com/rubygems/rubygems/commit/ab7d65cc18 Co-authored-by: Nobuyoshi Nakada <nobu@ruby-lang.org>
Diffstat (limited to 'lib')
-rw-r--r--lib/rubygems/installer.rb6
1 files changed, 5 insertions, 1 deletions
diff --git a/lib/rubygems/installer.rb b/lib/rubygems/installer.rb
index 520cf2e43c..7f5d913ac4 100644
--- a/lib/rubygems/installer.rb
+++ b/lib/rubygems/installer.rb
@@ -1004,7 +1004,11 @@ TEXT
_=_\\
=begin
bindir="${0%/*}"
- exec "$bindir/#{ruby_install_name}" "-x" "$0" "$@"
+ ruby="$bindir/#{ruby_install_name}"
+ if [ ! -f "$ruby" ]; then
+ ruby="#{ruby_install_name}"
+ fi
+ exec "$ruby" "-x" "$0" "$@"
=end
EOS
else