Skip to content

Commit 1b298fa

Browse files
k0kubunXrXr
andauthored
Fix the chruby hack for non-ruby commands (#343)
Co-authored-by: Alan Wu <[email protected]>
1 parent fb25c3c commit 1b298fa

File tree

1 file changed

+3
-2
lines changed

1 file changed

+3
-2
lines changed

run_benchmarks.rb

Lines changed: 3 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -281,8 +281,9 @@ def run_benchmarks(ruby:, ruby_description:, categories:, name_filters:, out_pat
281281
# like `bundle install` in a child process will not use the Ruby being benchmarked.
282282
# It overrides PATH to guarantee the commands of the benchmarked Ruby will be used.
283283
env = {}
284-
if `#{ruby.first} -e 'print RbConfig.ruby'` != RbConfig.ruby
285-
env["PATH"] = "#{File.dirname(ruby.first)}:#{ENV["PATH"]}"
284+
ruby_path = `#{ruby.shelljoin} -e 'print RbConfig.ruby'`
285+
if ruby_path != RbConfig.ruby
286+
env["PATH"] = "#{File.dirname(ruby_path)}:#{ENV["PATH"]}"
286287

287288
# chruby sets GEM_HOME and GEM_PATH in your shell. We have to unset it in the child
288289
# process to avoid installing gems to the version that is running run_benchmarks.rb.

0 commit comments

Comments
 (0)