From 7ddb84afcee0bf98abdfa97c33bab3d06f7d3613 Mon Sep 17 00:00:00 2001 From: Takashi Kokubun Date: Thu, 24 Oct 2024 10:49:58 -0700 Subject: [PATCH] Fix the chruby hack for non-ruby commands Co-authored-by: Alan Wu --- run_benchmarks.rb | 5 +++-- 1 file changed, 3 insertions(+), 2 deletions(-) diff --git a/run_benchmarks.rb b/run_benchmarks.rb index d8db9b38..971319dd 100755 --- a/run_benchmarks.rb +++ b/run_benchmarks.rb @@ -281,8 +281,9 @@ def run_benchmarks(ruby:, ruby_description:, categories:, name_filters:, out_pat # like `bundle install` in a child process will not use the Ruby being benchmarked. # It overrides PATH to guarantee the commands of the benchmarked Ruby will be used. env = {} - if `#{ruby.first} -e 'print RbConfig.ruby'` != RbConfig.ruby - env["PATH"] = "#{File.dirname(ruby.first)}:#{ENV["PATH"]}" + ruby_path = `#{ruby.shelljoin} -e 'print RbConfig.ruby'` + if ruby_path != RbConfig.ruby + env["PATH"] = "#{File.dirname(ruby_path)}:#{ENV["PATH"]}" # chruby sets GEM_HOME and GEM_PATH in your shell. We have to unset it in the child # process to avoid installing gems to the version that is running run_benchmarks.rb.