Search code examples
rubymacostextmate

How do I change the Ruby version Textmate uses?


EDIT: I found a solution for this, you can read it in my answer bellow.

I am using Textmate on Snow Leopard, and have installed ruby 1.9. The problem is that for some reason Textmate uses Ruby 1.8.2

But when I use IRB, or run ruby scripts for the shell, the proper version of Ruby (1.9) is used.

How can I configure Textmate so it uses 1.9.2?

I've been googling and apparently you have to use the T_RUBY variable and textmate, and set some environment variable in OSX, but so far none of the methods I've found works for me.

Could someone give a step by step solution to this problem?

Update: I already tried adding the ruby binary path to TM_RUBY in textmate, and I get this error:

> Can't find
> “/Users/myname/.rvm/rubies/ruby-1.9.2-p180/bin/ruby
> /Users/myname/.rvm/rubies/ruby-1.9.2-p180/bin/ruby
> /Users/myname/.rvm/rubies/ruby-1.9.2-p180/bin/ruby
> ” on PATH. Theme: The current PATH is:
> /usr/bin /bin /usr/sbin /sbin Please
> add the directory containing
> “/Users/myname/.rvm/rubies/ruby-1.9.2-p180/bin/ruby
> /Users/myname/.rvm/rubies/ruby-1.9.2-p180/bin/ruby
> /Users/myname/.rvm/rubies/ruby-1.9.2-p180/bin/ruby
> ” to PATH in TextMate's Shell
> Variables preferences.

Solution

  • Using the path that which ruby gave me didnt work. After googling for a while, I found a solution that worked, using the auto-ruby path of rvm as the TM_RUBY variable. The path is: /Users/0al0/.rvm/bin/rvm-auto-ruby This only applies if you are using rvm, of course.