Replacing ERB with Erubis

Hey guys,

I've been hearing a lot about erubis:
Especially about how much faster it is than straight ERB.

In their Ruby on Rails support docs:
They state that with a few added lines to your environment.rb it will
replace ERB completely.

I'm wondering if anyone has done this in an existing application and
if there are any existing ERB area's this might break. I'd also like
to hear anyone's experience with Erubis in general. Thanks.

I wrote up some notes on my experiences a couple of months ago:

As I understand it the compatibility issues that were a problem earlier on are now resolved. I know I’ve not had any problems.



Thanks, I'll check out your writeup. Overall this looks like a good
drop-in solution (assuming those issues were fixed). Can't beat a 3x
speed increase! :slight_smile:

Curious about the proposed patch: How does moving object instantiation into a separate method increase speed? Unless I’m actually blind, the patch on this page (
) would do nothing for increasing speed.

Is there something monkey patched in that take advantage of this change?


Just checked out erubis. The newest version does the patch for you (check out rails_helper.rb).