HanXu
HanXu

Reputation: 5597

Textmate does not run ruby with the latest version

I have updated my ruby to 1.9.3.

However, when I run my ruby code in Textmate, it still run with 1.8.7 version.

To be more specific, here is my test code, just one line:

#!/usr/bin/env ruby -v

when running in Textmate (command + R), the result is:

ruby 1.8.7 (2012-02-08 patchlevel 358) [universal-darwin12.0]

when running in the command line (./test.rb), the result is:

ruby 1.9.3p194 (2012-04-20 revision 35410) [x86_64-darwin12.0.0]

so how to edit my Textmate to support the newest ruby?

Upvotes: 3

Views: 1167

Answers (1)

user1613360
user1613360

Reputation: 1314

Try to edit the TM_RUBY shell variable to point to your newly installed version. According to the docs, it should be somewhere under /usr/local (most likely /usr/local/bin/ruby).

You can find out the location of your ruby installation by typing the following in your terminal window:

$ which ruby
/usr/local/bin/ruby

then perform the following to verify the version

$ ruby -v

Once you have the proper ruby path, in Textmate, double-click the 'value' of the TM_RUBY shell variable & type in the path to your 1.9.3 install.

Upvotes: 3

Related Questions