diff options
| author | Mike McQuaid | 2017-11-04 16:31:18 +0000 | 
|---|---|---|
| committer | Mike McQuaid | 2017-11-05 14:45:36 +0000 | 
| commit | b369593cbdecd9e065adc9b553cc4d7530c90c0c (patch) | |
| tree | 9e62378d9b3482d37dea24a0478a7961f668f0c9 | |
| parent | f999a57620d761065415bcd2d2a4141208a96eb9 (diff) | |
| download | brew-b369593cbdecd9e065adc9b553cc4d7530c90c0c.tar.bz2 | |
utils: correctly handle empty user gem env.
| -rw-r--r-- | Library/Homebrew/utils.rb | 7 | 
1 files changed, 5 insertions, 2 deletions
| diff --git a/Library/Homebrew/utils.rb b/Library/Homebrew/utils.rb index 0c875a8ab..1d16044da 100644 --- a/Library/Homebrew/utils.rb +++ b/Library/Homebrew/utils.rb @@ -189,8 +189,11 @@ module Homebrew    def install_gem_setup_path!(name, version = nil, executable = name)      # Respect user's preferences for where gems should be installed. -    ENV["GEM_HOME"] = ENV["HOMEBREW_GEM_HOME"].to_s -    ENV["GEM_HOME"] = Gem.user_dir if ENV["GEM_HOME"].empty? +    ENV["GEM_HOME"] = if ENV["HOMEBREW_GEM_HOME"].to_s.empty? +      Gem.user_dir +    else +      ENV["HOMEBREW_GEM_HOME"] +    end      unless ENV["HOMEBREW_GEM_PATH"].to_s.empty?        ENV["GEM_PATH"] = ENV["HOMEBREW_GEM_PATH"]      end | 
