Of Finder Search Path and Textmate
Labels: finder, path, textmate
Textmate became my favorite text editor ever since I started using a Mac. Textmate has a feature that is very powerful, but intuitive at the same time. It has support for evaluating Ruby expressions within the editor window. It is actually defined in the Ruby bundle, but is available in all contexts with the shortcut key Cmd-Shift-E.
As an example, here is an expression that I type in Textmate.
After, pressing Cmd-Shift-E, I get this in my editor window.
That is pretty neat. However, I had some initial pain trying to configure it with the right version of Ruby. The default version of Ruby that comes installed with Mac OS X Tiger is 1.8.2. I have however, following some excellent instructions upgraded my Ruby installation to run 1.8.6. I had configured all the paths correctly in my .profile to point to the right Ruby version, which Textmate apparently respects, but on evaluating puts #{RUBY_VERSION}, I kept getting 1.8.2
After searching a few docs, I found the solution which involved changing the default Finder path, which gets set on login. Apparently, Textmate was still using the default Finder path for evaluating the Ruby expressions. So I went into ~/.MacOSX/environment.plist (you will most likely have to create this) and put this in
{ PATH = "/usr/local/bin:/usr/local/sbin:/usr/local/mysql/bin:/opt/local/bin:/opt/local/sbin:/bin:/sbin:/usr/bin:/usr/sbin"; }This will make sure that Finder picks up the right Ruby version in /usr/local/bin. You can easily test it in Textmate too :).



Hi Jois,
Sounds impressive. I think the link for http://textmate.com is broken.
Post a Comment