diff options
author | Samuel Giddins <[email protected]> | 2023-02-13 18:46:24 -0800 |
---|---|---|
committer | git <[email protected]> | 2023-02-22 08:42:18 +0000 |
commit | 80bfa1b30af7aae60e96f17e86f3a2c5a566ee12 (patch) | |
tree | b7df8f7b4ed586e847e473b179f8154a97182949 /lib | |
parent | 2dd96983505285bf58845d1687a9a6d6c0af959b (diff) |
[rubygems/rubygems] Fix resetting env in gem exec, and make sure it is set for gem exec gem
https://github.com/rubygems/rubygems/commit/13a6dd4992
Diffstat (limited to 'lib')
-rw-r--r-- | lib/rubygems/commands/exec_command.rb | 6 |
1 files changed, 4 insertions, 2 deletions
diff --git a/lib/rubygems/commands/exec_command.rb b/lib/rubygems/commands/exec_command.rb index 463308627a..87c1cf9051 100644 --- a/lib/rubygems/commands/exec_command.rb +++ b/lib/rubygems/commands/exec_command.rb @@ -56,12 +56,13 @@ to the same gem path as user-installed gems. end def execute - gem_paths = { "GEM_HOME": Gem.paths.home, "GEM_PATH": Gem.paths.path, "GEM_SPEC_CACHE": Gem.paths.spec_cache_dir } + gem_paths = { "GEM_HOME" => Gem.paths.home, "GEM_PATH" => Gem.paths.path.join(Gem.path_separator), "GEM_SPEC_CACHE" => Gem.paths.spec_cache_dir } check_executable print_command if options[:gem_name] == "gem" && options[:executable] == "gem" + set_gem_exec_install_paths Gem::GemRunner.new.run options[:args] return elsif options[:conservative] @@ -73,7 +74,8 @@ to the same gem path as user-installed gems. load! ensure - Gem.paths = gem_paths + ENV.update(gem_paths) + Gem.clear_paths end private |