diff --git a/lib/rubygems/installer.rb b/lib/rubygems/installer.rb index 896f3b4f58..e5df0b4e71 100644 --- a/lib/rubygems/installer.rb +++ b/lib/rubygems/installer.rb @@ -196,9 +196,10 @@ class Gem::Installer 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`. + # If we get here, then one of the following likely happened: + # - `--user-install` was specified + # - `Gem::PathSupport#home` fell back to `Gem.user_dir` + # - GEM_HOME was manually set to `Gem.user_dir` check_that_user_bin_dir_is_in_path end diff --git a/spec/bundler/commands/doctor_spec.rb b/spec/bundler/commands/doctor_spec.rb index 9eb496b0b2..666b23a141 100644 --- a/spec/bundler/commands/doctor_spec.rb +++ b/spec/bundler/commands/doctor_spec.rb @@ -39,7 +39,7 @@ RSpec.describe "bundle doctor" do allow(File).to receive(:writable?).with(unwritable_file) { true } allow(File).to receive(:readable?).with(unwritable_file) { true } - # The following 2 lines are for `Gem::PathSupport#initialize`. + # The following lines are for `Gem::PathSupport#initialize`. allow(File).to receive(:exist?).with(Gem.default_dir) allow(File).to receive(:writable?).with(Gem.default_dir) allow(File).to receive(:writable?).with(File.expand_path("..", Gem.default_dir))