[TxMt] Screwed up my ruby integration - help!

Mathias Meyer mm at beatsteaks.de
Sat Sep 10 16:29:36 UTC 2005

On 10.09.2005, at 16:53, Gavin Kistner wrote:

> Hey, I somehow hosed TextMate's ability to perform the Run Ruby  
> command, and I don't know how I did it, or how to fix. (Or rather,  
> I know how I did it, but I don't understand why it broke.)
> Symptom 1: invoking Run Ruby command produces
> "/usr/local/bin/ruby: No such file or directory -- /Users/ 
> gavinkistner/Library/Application Support/TextMate/Bundles/ 
> Ruby.tmbundle/Supprt/tmruby.rb (LoadError)"
Hehe, coincidentally I just had the same problem. Your SVN-checkout  
version is in /Library/Application Support/TextMate right?

I too removed the -w from the ruby execution line and had the exact  
same problem. This seems to be due to the nature of the  
$TM_BUNDLE_PATH variable which doesn't work correctly in custom  
bundles. As soon as you change something in the default bundle,  
TextMate creates a copy in ~/Library/Application Support/TextMate,  
Ruby.tmbundle in our case. And when used from a copied bundle (which  
does not contain the tmruby.rb aka RubyMate) the $TM_BUNDLE_PATH  
variable points to your custom application support directory. I  
circumvented this problem by using the newest build (available here:  
http://macromates.com/textmate/build/TextMate_r385.zip) and using  
$TM_BUNDLE_SUPPORT instead of $TM_BUNDLE_PATH, so that my default  
setup to run Ruby looks like this:
${TM_RUBY:=ruby} -- "$TM_BUNDLE_SUPPORT/tmruby.rb" "$TM_FILEPATH"

I don't have an answer to problem 2, though, but the problem is  
likely to be the ri command itself, since it relies on /usr/bin/ruby  
to exist. You could either change it to match your setup (/usr/local/ 
bin/ruby) or use #!/usr/bin/env ruby as a shebang line in /usr/bin/ri  
and then set the PATH variable in the TextMate command:
ri -Tf html "$MY_FUNC_TO_CHECK"

Not tested, but should work ;)

Hope that helps.

Cheers, Mathias
"Steve Jobs has said that Xwindows is brain-damaged and will  
disappear in two years. He got it half-right." - Dennis Ritchie

More information about the textmate mailing list