aboutsummaryrefslogtreecommitdiffstats
path: root/Library/Homebrew/global.rb
diff options
context:
space:
mode:
Diffstat (limited to 'Library/Homebrew/global.rb')
-rw-r--r--Library/Homebrew/global.rb10
1 files changed, 8 insertions, 2 deletions
diff --git a/Library/Homebrew/global.rb b/Library/Homebrew/global.rb
index 6fd01d149..e8e865976 100644
--- a/Library/Homebrew/global.rb
+++ b/Library/Homebrew/global.rb
@@ -68,8 +68,14 @@ HOMEBREW_LOGS = Pathname.new(ENV['HOMEBREW_LOGS'] || '~/Library/Logs/Homebrew/')
HOMEBREW_TEMP = Pathname.new(ENV.fetch('HOMEBREW_TEMP', '/tmp'))
-RUBY_BIN = Pathname.new(RbConfig::CONFIG['bindir'])
-RUBY_PATH = RUBY_BIN + RbConfig::CONFIG['ruby_install_name'] + RbConfig::CONFIG['EXEEXT']
+if RbConfig.respond_to?(:ruby)
+ RUBY_PATH = Pathname.new(RbConfig.ruby)
+else
+ RUBY_PATH = Pathname.new(RbConfig::CONFIG["bindir"]).join(
+ RbConfig::CONFIG["ruby_install_name"] + RbConfig::CONFIG["EXEEXT"]
+ )
+end
+RUBY_BIN = RUBY_PATH.dirname
if RUBY_PLATFORM =~ /darwin/
MACOS_FULL_VERSION = `/usr/bin/sw_vers -productVersion`.chomp