diff --git a/lib/rubygems/commands/exec_command.rb b/lib/rubygems/commands/exec_command.rb index c708ad78ad..a0837865f9 100644 --- a/lib/rubygems/commands/exec_command.rb +++ b/lib/rubygems/commands/exec_command.rb @@ -56,7 +56,7 @@ to the same gem path as user-installed gems. end def execute - gem_paths = { "GEM_HOME" => Gem.paths.home, "GEM_PATH" => Gem.paths.path.join(Gem.path_separator), "GEM_SPEC_CACHE" => Gem.paths.spec_cache_dir }.compact + gem_paths = { "GEM_HOME" => Gem.paths.home, "GEM_PATH" => Gem.paths.path.join(File::PATH_SEPARATOR), "GEM_SPEC_CACHE" => Gem.paths.spec_cache_dir }.compact check_executable @@ -144,7 +144,7 @@ to the same gem path as user-installed gems. def set_gem_exec_install_paths home = File.join(Gem.dir, "gem_exec") - ENV["GEM_PATH"] = ([home] + Gem.path).join(Gem.path_separator) + ENV["GEM_PATH"] = ([home] + Gem.path).join(File::PATH_SEPARATOR) ENV["GEM_HOME"] = home Gem.clear_paths end diff --git a/test/rubygems/test_gem_commands_exec_command.rb b/test/rubygems/test_gem_commands_exec_command.rb index 40f6bf0b09..8af521b306 100644 --- a/test/rubygems/test_gem_commands_exec_command.rb +++ b/test/rubygems/test_gem_commands_exec_command.rb @@ -270,6 +270,7 @@ class TestGemCommandsExecCommand < Gem::TestCase use_ui @ui do util_set_arch "unknown-unknown" invoke "a" + assert_empty @ui.error assert_equal "Building native extensions. This could take a while...\na-2\nsometimes_used-2\nwith_platform-2\n", @ui.output end