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!

15 Comments

Filed under rails, tips, tutorial

15 responses to “Getting TextMate ready for Rails 2.0

  1. 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. Right! Good to know, but don’t you prefer the permanent way?

  3. Love it!

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

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

  5. 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. jorge

    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. 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. 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. 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?

  10. Pingback: Programblings » Blog Archive » How to load gems only when your tests are not run from TextMate

  11. Sweet blog. I never know what I am going to come across next. I think you should do more posting as you have some pretty intelligent stuff to say.

    I’ll be watching you . 🙂

  12. Nice blog, keep posting this type of very thoughtful topics to blog

  13. It’s hard to find knowledgeable people on this topic however you sound like you know what you’re talking about! Thanks

  14. This excellent website rocks !. I continuously discovered interesting things & distinct right here. Thank you for that details.

  15. It was good to read through your publish. I personally liked the couple of minutes i put in reading through it and wished to leave a comment to say that….All the best

Leave a comment