diff options
| -rw-r--r-- | Library/Homebrew/extend/fileutils.rb | 6 | ||||
| -rw-r--r-- | Library/Homebrew/formula_installer.rb | 2 | ||||
| -rw-r--r-- | Library/Homebrew/global.rb | 5 |
3 files changed, 8 insertions, 5 deletions
diff --git a/Library/Homebrew/extend/fileutils.rb b/Library/Homebrew/extend/fileutils.rb index a7a1ae41c..231d3b769 100644 --- a/Library/Homebrew/extend/fileutils.rb +++ b/Library/Homebrew/extend/fileutils.rb @@ -81,13 +81,11 @@ module FileUtils extend self end end - RUBY_BIN = '/System/Library/Frameworks/Ruby.framework/Versions/1.8/usr/bin' - def rake *args - system "#{RUBY_BIN}/rake", *args + system RUBY_BIN/'rake', *args end def ruby *args - system "#{RUBY_BIN}/ruby", *args + system RUBY_PATH, *args end end diff --git a/Library/Homebrew/formula_installer.rb b/Library/Homebrew/formula_installer.rb index 0a1eba69e..a84502ed8 100644 --- a/Library/Homebrew/formula_installer.rb +++ b/Library/Homebrew/formula_installer.rb @@ -285,7 +285,7 @@ class FormulaInstaller begin read.close exec '/usr/bin/nice', - '/System/Library/Frameworks/Ruby.framework/Versions/1.8/usr/bin/ruby', + RUBY_PATH, '-W0', '-I', Pathname.new(__FILE__).dirname, '-rbuild', diff --git a/Library/Homebrew/global.rb b/Library/Homebrew/global.rb index de08f9267..761dd1eb7 100644 --- a/Library/Homebrew/global.rb +++ b/Library/Homebrew/global.rb @@ -7,6 +7,7 @@ require 'extend/object' require 'utils' require 'exceptions' require 'set' +require 'rbconfig' ARGV.extend(HomebrewArgvExtension) @@ -63,6 +64,10 @@ end HOMEBREW_LOGS = Pathname.new('~/Library/Logs/Homebrew/').expand_path +RUBY_CONFIG = RbConfig::CONFIG +RUBY_BIN = Pathname.new("#{RUBY_CONFIG['bindir']}") +RUBY_PATH = RUBY_BIN/RUBY_CONFIG['ruby_install_name'] + RUBY_CONFIG['EXEEXT'] + if RUBY_PLATFORM =~ /darwin/ MACOS_FULL_VERSION = `/usr/bin/sw_vers -productVersion`.chomp MACOS_VERSION = /(10\.\d+)(\.\d+)?/.match(MACOS_FULL_VERSION).captures.first.to_f |
