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 to import libraries from JAR-files into a Java
- CoffeeScript TextMate Run Command
- How can I convert a Sublime Text syntax highlighti
- How can I use specific protocol (in my case : txmt
- Emacs session / projects / window management
相关文章
- How do I use a shortcut to comment out code automa
- Autocomplete in Textmate
- How to update GetBundles in TextMate?
- Completely uninstall/restore Textmate 2
- .vim syntax highlighting to textmate or sublime te
- Can't build XCode 4 Project from Textmate
- Textmate 2 Alpha showing references for deleted fi
- Calling vim or TextMate from emacs
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.
Simpler answers:
Install MacRuby
Go to TextMate->Preferences->Advanced->Shell Variables and add a variable named
TM_RUBY
set to/usr/local/bin/macruby
.PATH
variable to include/usr/local/bin/
and just setTM_RUBY
tomacruby
.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).PATH
variable to include/Users/yourusername/.rvm/bin
and just setTM_RUBY
tomacruby
.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.