From e84b73398b96ea7abbeb3a17caae71b365f5016d Mon Sep 17 00:00:00 2001 From: Ellen Marie Dash Date: Fri, 29 Sep 2023 22:59:01 -0400 Subject: [rubygems/rubygems] Call check_that_user_bin_dir_is_in_path ANY time Gem.paths.home == Gem.user_dir. (As opposed to only if `--user-install` is passed.) https://github.com/rubygems/rubygems/commit/0b42d0e869 --- lib/rubygems/installer.rb | 7 +++++++ 1 file changed, 7 insertions(+) (limited to 'lib/rubygems') diff --git a/lib/rubygems/installer.rb b/lib/rubygems/installer.rb index 162a50fdb7..896f3b4f58 100644 --- a/lib/rubygems/installer.rb +++ b/lib/rubygems/installer.rb @@ -193,6 +193,13 @@ class Gem::Installer @gem_home = Gem.user_dir @bin_dir = Gem.bindir gem_home unless options[:bin_dir] @plugins_dir = Gem.plugindir(gem_home) + end + + if @gem_home == Gem.user_dir + # If we get here, then: + # 1. `--user-install` was specified, or + # 2. GEM_HOME was not writable, and `Gem::PathSupport` fell back to `Gem.user_dir`. + check_that_user_bin_dir_is_in_path end end -- cgit v1.2.3