Skip to content

Commit

Permalink
Unset GEM_HOME and GEM_PATH for chruby (#138)
Browse files Browse the repository at this point in the history
  • Loading branch information
k0kubun committed Nov 22, 2022
1 parent fcda8b4 commit 69d3ab3
Showing 1 changed file with 6 additions and 0 deletions.
6 changes: 6 additions & 0 deletions run_benchmarks.rb
Original file line number Diff line number Diff line change
Expand Up @@ -244,6 +244,12 @@ def run_benchmarks(ruby:, ruby_description:, name_filters:, out_path:, pre_init:
env = {}
if `#{ruby.first} -e 'print RbConfig.ruby'` != RbConfig.ruby
env["PATH"] = "#{File.dirname(ruby.first)}:#{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.
["GEM_HOME", "GEM_PATH"].each do |var|
env[var] = nil if ENV.key?(var)
end
end

# Do the benchmarking
Expand Down

0 comments on commit 69d3ab3

Please sign in to comment.