Skip to content

Commit 24b190c

Browse files
committed
Remove existing from PATH when adding Gem.bindir.
1 parent 6b005ab commit 24b190c

File tree

1 file changed

+1
-4
lines changed

1 file changed

+1
-4
lines changed

Library/Homebrew/utils.rb

Lines changed: 1 addition & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -189,14 +189,11 @@ def install_gem_setup_path!(name, version = nil, executable = name)
189189
Gem.clear_paths
190190
Gem::Specification.reset
191191

192-
# Create GEM_HOME which may not exist yet so it exists when creating PATH.
193-
FileUtils.mkdir_p Gem.bindir
194-
195192
# Add Gem binary directory and (if missing) Ruby binary directory to PATH.
196193
path = PATH.new(ENV["PATH"])
197194
path.prepend(RUBY_BIN) if which("ruby") != RUBY_PATH
198195
path.prepend(Gem.bindir)
199-
ENV["PATH"] = path.existing
196+
ENV["PATH"] = path
200197

201198
if Gem::Specification.find_all_by_name(name, version).empty?
202199
ohai "Installing or updating '#{name}' gem"

0 commit comments

Comments
 (0)