views:

164

answers:

2

Hi,

I'm using a pre-commit hook for Git that checks the syntax of my files before I can commit them.

In a Rails 3 app (I'm using the new form helper's syntax : <%= form_for @article do |f| %> but I get a syntax error, not when I use the app, but when I check for the syntax through the ruby CLI command or the Textmate's bundle command.

The command that is executed is erb -xT - #{file} | ruby -c so it goes through erb before ruby. If I change the erb binary to erubis, I get the same error.

I've tried to create a blank Rails3 app, with a generic scaffold, and the result is exactly the same.

I've also tried this with REE 1.8.7 2010.02, 1.8.7-p174, 1.9.2-preview3, … and I get the same error.

A: 

Isn't it complaining about the <%= instead of <% used in rails 2.x versions?

what exactly is the error you get?

Angelus
A: 

I think figured out what's causing this, but I don't know how to fix it. Any ideas?

Rails 3 has its own version of erb; looks like it's based on erubis. TextMate uses the (older) /usr/bin/erb that comes with Snow Leopard.

I don't know whether (or how) the Rails 3 erb can be run as a stand-alone shell command, and I don't know how (or if I want) to replace /usr/bin/erb with the newer one, given that it "requires" a bunch of erubis code that would have to be installed somewhere.

Jim Haungs