So, how do I get Textmate to use MacRuby, a branch of 1.9.2, instead of the default Ruby in OSX, 1.8.7?
How do I get Textmate to use MacRuby?
1.1k views Asked by johnrubythecat At
2
There are 2 answers
0
On
Simpler answers:
Install MacRuby
Go to TextMate->Preferences->Advanced->Shell Variables and add a variable named
TM_RUBY
set to/usr/local/bin/macruby
.- Alternatively, edit the
PATH
variable to include/usr/local/bin/
and just setTM_RUBY
tomacruby
.
- Alternatively, edit the
If you have installed MacRuby through RVM, then instead:
Generate stable wrapper:
rvm wrapper macruby-0.8 macruby
# creates ~/.rvm/bin/macrubySet
TM_RUBY
to/Users/yourusername/.rvm/bin/macruby
(must be the absolute path).- Alternatively, edit the
PATH
variable to include/Users/yourusername/.rvm/bin
and just setTM_RUBY
tomacruby
.
- Alternatively, edit the
In case it wasn't obvious from the UI, you can use the checkbox next to TM_RUBY
to enable or disable its use in TextMate.
Been working on this since last night…finally got it to work
How to Get MacRuby Running on TextMate
By (johnrubythecat*)
*reference to john robie, "the cat", thief played by cary grant in To Catch A Thief
Ruby on OS X is currently 1.8.7 But latest version of Ruby is 1.9.2 (MUCH faster) And MacRuby (much better than RubyCocoa) is built on 1.9.2
So here are instructions for easily building mac desktop apps using ruby
INSTALL RVM
1) install rvm with git
1.2) source command in .bash_profile or .bashrc (so rvm bin can be found):
source $HOME/.rvm/scripts/rvm
INSTALL MACRUBY
2) Use rvm to install MacRuby
3) then,
rvm --default macruby-0.8
(or at least
rvm use macrmacruby-0.8
)CONFIGURE TEXTMATE
4) update Textmate bundles with this script, just to make sure you're up to date; see:
5) Generate Ruby wrapper wrapper for TextMate
rvm wrapper macruby-0.8 textmate
wrapper is in
$HOME/.rvm/bin
; it's calledtextmate_ruby
6) go to shell variables in TextMate preferences and set
TM_RUBY
to/Users/homedirname/.rvm/bin/textmate_ruby
that should do it
RUN YOUR APP
7) this script ran great —opens a Cocoa window
And here is a video discussing how to integrate MacRuby with XCode.
http://thinkcode.tv/catalog/introduction-macruby/
It's 8.99, but I am recommending something I purchased myself. It's MacRuby is out of date (0.6), but it shows the nuts and bolts of using MacRuby in XCode, including setting up the XIB and making connections, creating the application delegate, setting up Textmate as your external editor.
Quite useful. Recommended.