TextMate 1.5.10 … and Ruby 1.9.2

There’s a new version of Textmate available. Cool, thanks! However after installing … I couldn’t run Rake tasks anymore (the keyboard short cut to remember: Shift-Ctrl-R).

In ‘rake_mate.rb’ (line 49, /Applications/TextMate.app/Contents/SharedSupport/Bundles/Ruby.tmbundle/Support/RakeMate/rake_mate.rb). I inserted “.lines” to make it look like this:

tasks = [DEFAULT_TASK] + tasks.lines.grep(/^rake\s+(\S+)/) { |t| t.split[1] }

Additionally I had to ‘re-copy’ the plist.bundle as described on the rvm site.
Now everything works fine again.

Addendum: As mentioned in the rvm guide to using TextMate, I had to (re) move TextMate’s own Builder.rb out of the way:

cd /Applications/TextMate.app/Contents/SharedSupport/Support/lib/ ; mv Builder.rb Builder.rb.backup

Another note to self: RVM, TextMate and Ruby 1.9.2

Getting rvm and Ruby 1.9.2 and TextMate can be a bit of work, especially if you’re using rake as well inside TextMate.

Good Thing there’s a solution already: Jim blogged about it at “RVM, ruby 1.9 and TextMate“. Thanks Jim!



TextMate, Ruby & String Interpolation

While preparing some code example for the Euruko 2007 I noticed a somewhat strange behaviour of TextMate while editing Ruby code. With the Ruby bundle being active, I expect CMD-R (“Apple-R”) to execute the Ruby code a hand. Which it does, unless the text cursor is inside a string interpolation expression.

An example: The first screen shot shows the example code, the cursor being positioned outside the #{ … }.


After CMD-R is hit, the output is the expected Ruby output as shown below.


However, if the cursor is inside the string interpolation expression as below


the result of hitting CMD-R doesn’t meet my expectation:


I wonder why this happens. Apparently the behaviour has to do the the scope the cursor is in. A hint about how to avoid this is greatly appreciated.