# Multiple erb rendering

**URL:** <https://www.ruby-forum.com/t/multiple-erb-rendering/214041>\
**Category:** JRuby\
**Created:** [November 19, 2011, 10:57am UTC](https://www.ruby-forum.com/t/multiple-erb-rendering/214041 "2011-11-19T10:57:30Z")\
**Posts on this page:** 2\
**Page:** 1

<div class="post-metadata">

**Author:** ![dubstep](https://www.ruby-forum.com/letter_avatar_proxy/v4/letter/d/cdc98d/32.png) [@dubstep](https://www.ruby-forum.com/u/dubstep)\
**Post date:** [November 19, 2011, 10:57am UTC](https://www.ruby-forum.com/t/multiple-erb-rendering/214041/1 "2011-11-19T10:57:30Z")

</div>

Hi everybody,

I’m moving a Rails 3.1.1 to JRuby, but I’m finding some issues.

I tried first using JRuby 1.6.5 and 1.6.4, but I encountered this bug  
[1]. I also tried to use torquebox as web server, but nothing changes.

So I tried to move back to JRuby 1.6.3 and this bug disappears. The  
problem here lives in the views rendering. In fact, when I render a  
page, it is re-rendered every time it JRuby finds an erb tag (\<%= %\>),  
or at least this is the behaviour I came up with looking at the pages  
resulting. In other words, if you check the link [2], you can see how  
many times the HTML restart (you see the head tag multiple times).

Now, I can’t really understand why it behaves in this way, and after  
some researches, I wanted to ask to you some help.

Thanks in advance.

[1] [http://jira.codehaus.org/browse/JRUBY-6164](http://jira.codehaus.org/browse/JRUBY-6164)  
[2] [http://pastie.org/2883038](http://pastie.org/2883038)

---

<div class="post-metadata">

**Author:** ![reis](https://www.ruby-forum.com/letter_avatar_proxy/v4/letter/r/f1d935/32.png) [@reis](https://www.ruby-forum.com/u/reis)\
**Post date:** [November 19, 2011, 4:27pm UTC](https://www.ruby-forum.com/t/multiple-erb-rendering/214041/2 "2011-11-19T16:27:58Z")

</div>

On Sat, Nov 19, 2011 at 1:57 AM, Andrea R. [removed\_email\_address@domain.invalid](mailto:removed_email_address@domain.invalid)  
wrote:

> I’m moving a Rails 3.1.1 to JRuby, but I’m finding some issues.
> 
> I tried first using JRuby 1.6.5 and 1.6.4, but I encountered this bug  
> [1]. I also tried to use torquebox as web server, but nothing changes.
> 
> So I tried to move back to JRuby 1.6.3 and this bug disappears. The  
> problem here lives in the views rendering. In fact, when I render a  
> page, it is re-rendered every time it JRuby finds an erb tag (\<%= %\>),

Can you provide a simplified test case?

With a fresh install of 3.1.1, using either JRuby 1.6.3 or 1.6.5, and a  
simple demo app running on webrick, I don’t see either the error you  
referenced or the multiple rendering problem.

–  
Hassan S. ------------------------ removed\_email\_address@domain.invalid

> **[Hassan Schroeder on about.me](https://about.me/hassanschroeder)**
>
> I use about.me to show people what matters most to me.

twitter: @hassan
