diff --git a/Library/Homebrew/utils.rb b/Library/Homebrew/utils.rb index 83b8ba34248932497a392a5e43c9332ef05fc466..59415906d7a8265e6d4975110bbb743c9cef6838 100644 --- a/Library/Homebrew/utils.rb +++ b/Library/Homebrew/utils.rb @@ -189,6 +189,9 @@ module Homebrew Gem.clear_paths Gem::Specification.reset + # Create GEM_HOME which may not exist yet so it exists when creating PATH. + FileUtils.mkdir_p Gem.bindir + # Add Gem binary directory and (if missing) Ruby binary directory to PATH. path = PATH.new(ENV["PATH"]) path.prepend(RUBY_BIN) if which("ruby") != RUBY_PATH