From 5da1cc6c9c548bf95599ad7aa1b3877f8ccda953 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?David=20Rodr=C3=ADguez?= Date: Thu, 18 Jul 2024 20:17:55 +0200 Subject: [PATCH] [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 --- lib/rubygems/installer.rb | 6 +++++- 1 file changed, 5 insertions(+), 1 deletion(-) 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