Browse files

Ensure system ruby is used for “RubyMate”

Ruby 2.0 will close non-standard file descriptor when calling Kernel#exec, which means that the file descriptor used for printing the stack trace is unavailable in our child process.

Ruby 1.8.7 does not accept any options to Kernel#exec so it doesn’t seem like we can make the script compatible with both versions of ruby (at least not with simple code).

This should avoid issue #21.

Related thread on mailing list: http://lists.macromates.com/textmate/2013-March/036014.html
  • Loading branch information...
1 parent 659cf6e commit 6b42594bfa54fc259e10165e44ac51293bc4459f @sorbits sorbits committed Mar 9, 2013
Showing with 3 additions and 5 deletions.
  1. +3 −5 Commands/Run.tmCommand
View
8 Commands/Run.tmCommand
@@ -7,11 +7,9 @@
<key>beforeRunningCommand</key>
<string>saveModifiedFiles</string>
<key>command</key>
- <string>#!/bin/sh
-
-export RUBYLIB="$TM_BUNDLE_SUPPORT/RubyMate${RUBYLIB:+:$RUBYLIB}"
-
-/usr/bin/env ruby -KU -- "$TM_BUNDLE_SUPPORT/RubyMate/run_script.rb"
+ <string>#!/System/Library/Frameworks/Ruby.framework/Versions/Current/usr/bin/ruby -KU
+ENV['RUBYLIB'] = "#{ENV['TM_BUNDLE_SUPPORT']}/RubyMate"
+require "#{ENV['TM_BUNDLE_SUPPORT']}/RubyMate/run_script.rb"
</string>
<key>input</key>
<string>document</string>

0 comments on commit 6b42594

Please sign in to comment.