Getting TextMate ready for Rails 2.0

After updating a couple of existing Rails app to 2.0, I found out some of TextMate sugar was out of date. Here’s 2 things I did to put the hot and sweet sugar back into TextMate.

Update the bundle

TextMate bundles are under heavy development all the time, get the latest version from their repo:


svn export http://macromates.com/svn/Bundles/trunk/Bundles/Ruby%20on%20Rails.tmbundle

Then double-click on the downloaded Ruby on Rails.tmbundle.

Fix the test commands

I’m a heavy user of Run (command+R), Run Focused Unit Test (shift+command+R) and the Rails menu (shift+ctrl+\) but that do not work with Rails 2 because of a conflict with the builder module.

Rob Sanheim explain how to solve this very easily, just rename the Builder.rb in the Rails bundle.

Hope this helps!

9 Responses to “Getting TextMate ready for Rails 2.0”


  1. 1 James Golick December 16, 2007 at 7:33 am

    You can also put this at the top of your test_helper.rb file to solve the builder conflict:

    $:.reject! { |path| path.include? ‘TextMate’ }

  2. 2 macournoyer December 16, 2007 at 11:01 am

    Right! Good to know, but don’t you prefer the permanent way?

  3. 3 Carl Mercier December 16, 2007 at 12:07 pm

    Love it!

    I didn’t give Rails 2 a whirl yet, though… but I’ll be ready!

  4. 4 Something Short December 16, 2007 at 7:26 pm

    I ws not aware the builder module was the problem with this.

  5. 5 macournoyer December 17, 2007 at 10:14 am

    Moving to Rails 2 at work as easier then I though, but it still took a couple of days.

    thx for the comments all

  6. 6 jorge December 25, 2007 at 2:51 pm

    hi there I just installed texmate ti give it a try (coming from vim) and there is a bunch of things that dont seem to work with rails 2
    -scaffold generators
    -move to view (keeps searching .rhtml and now are erb)

    and some other that cant remember right now!

    does anyone know if there is a rails2 bundle coming soon?, my demo will expire before I can fully enjoy textmate I guess

    I checked the svn and there seems to be _not_ a lo of movement

    all this is weird since I think much of texmates´popularity is thanks to rails

  7. 7 macournoyer December 26, 2007 at 12:04 am

    hey jorge,

    the cool thing w/ TextMate Rails support is it’s all Ruby and easy to customize.
    I fixed mine in a sec by editing the Rails Bundle code in /Applications/TextMate.app/Contents/SharedSupport/Bundles/Ruby on Rails.tmbundle/Support/lib

    thx for the comment.

  8. 8 Jean-Francois Couture January 2, 2008 at 11:03 am

    What has changed in the bundle? Looking at the svn log doesn’t show much. I’m having all sorts of problem with migrations from textmate (can’t run them, remove/add column does not work). Are you experiencing any of these issues?

    Maybe the update didn’t work.

  9. 9 macournoyer January 2, 2008 at 12:23 pm

    support for the new template filename format is there. Migrations are working for me, but the snippets do not use the “sexy migration” format.

    What error do you get?

Leave a Reply




RefactorMyCode.comrefactorer Recommend Me

Top Clicks

  • None
Top Blogues page counter Add to Technorati Favorites

Blog Stats

  • 84,394 hits