aboutsummaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
-rw-r--r--lib/rubygems/installer.rb2
-rw-r--r--test/rubygems/test_gem_installer.rb10
2 files changed, 12 insertions, 0 deletions
diff --git a/lib/rubygems/installer.rb b/lib/rubygems/installer.rb
index c9d87c5617..0639672137 100644
--- a/lib/rubygems/installer.rb
+++ b/lib/rubygems/installer.rb
@@ -707,6 +707,8 @@ class Gem::Installer
user_bin_dir = user_bin_dir.tr(File::ALT_SEPARATOR, File::SEPARATOR) if File::ALT_SEPARATOR
path = ENV['PATH']
+ path = path.tr(File::ALT_SEPARATOR, File::SEPARATOR) if File::ALT_SEPARATOR
+
if Gem.win_platform?
path = path.downcase
user_bin_dir = user_bin_dir.downcase
diff --git a/test/rubygems/test_gem_installer.rb b/test/rubygems/test_gem_installer.rb
index 766a4ee8f2..49ecc549e9 100644
--- a/test/rubygems/test_gem_installer.rb
+++ b/test/rubygems/test_gem_installer.rb
@@ -207,6 +207,16 @@ gem 'other', version
end
assert_empty @ui.error
+
+ return unless win_platform?
+
+ ENV['PATH'] = [orig_PATH, bin_dir.tr(File::SEPARATOR, File::ALT_SEPARATOR)].join(File::PATH_SEPARATOR)
+
+ use_ui @ui do
+ installer.check_that_user_bin_dir_is_in_path
+ end
+
+ assert_empty @ui.error
ensure
ENV['PATH'] = orig_PATH
end