diff options
| author | Mike McQuaid | 2015-01-05 19:14:55 +0000 | 
|---|---|---|
| committer | Mike McQuaid | 2015-01-05 19:14:55 +0000 | 
| commit | 0376382ce1bf2028c068b32ce61ec3e6dcae69d6 (patch) | |
| tree | 83866f926fbe4f339718e9394a90f4cc13f5920d | |
| parent | 5b7fdc2b171c9444f06a582996bdb03a3181f285 (diff) | |
| download | homebrew-0376382ce1bf2028c068b32ce61ec3e6dcae69d6.tar.bz2 | |
utils: install_gem_setup_path! now checks PATH.
Check the executable is present to give a better error message if it isn't.
Closes #35541.
| -rw-r--r-- | Library/Homebrew/utils.rb | 17 | 
1 files changed, 13 insertions, 4 deletions
| diff --git a/Library/Homebrew/utils.rb b/Library/Homebrew/utils.rb index 16b228432..d4d8288c6 100644 --- a/Library/Homebrew/utils.rb +++ b/Library/Homebrew/utils.rb @@ -120,12 +120,21 @@ module Homebrew      HOMEBREW_REPOSITORY.cd { `git show -s --format="%cr" HEAD 2>/dev/null`.chuzzle }    end -  def self.install_gem_setup_path! gem +  def self.install_gem_setup_path! gem, executable=gem      require "rubygems"      ENV["PATH"] = "#{Gem.user_dir}/bin:#{ENV["PATH"]}" -    return if quiet_system "gem", "list", "--installed", gem -    system "gem", "install", "--no-ri", "--no-rdoc", -           "--user-install", gem + +    unless quiet_system "gem", "list", "--installed", gem +      safe_system "gem", "install", "--no-ri", "--no-rdoc", +                                    "--user-install", gem +    end + +    unless which executable +      odie <<-EOS.undent +        The '#{gem}' gem is installed but couldn't find '#{executable}' in the PATH: +        #{ENV["PATH"]} +      EOS +    end    end  end | 
