# Help needed with this ERB code

**URL:** <https://www.ruby-forum.com/t/help-needed-with-this-erb-code/110039>\
**Category:** Ruby\
**Created:** [July 21, 2007, 10:04pm UTC](https://www.ruby-forum.com/t/help-needed-with-this-erb-code/110039 "2007-07-21T22:04:28Z")\
**Posts on this page:** 2\
**Page:** 1

<div class="post-metadata">

**Author:** ![vfcforums](https://www.ruby-forum.com/letter_avatar_proxy/v4/letter/v/85e7bf/32.png) [@vfcforums](https://www.ruby-forum.com/u/vfcforums)\
**Post date:** [July 21, 2007, 10:04pm UTC](https://www.ruby-forum.com/t/help-needed-with-this-erb-code/110039/1 "2007-07-21T22:04:28Z")

</div>

Is there any code in this ERB snippet that causes text after the EOF  
to be included in the template.

Unless my understanding of ERB is inadequate there has to be some bug in  
it.  
It has me at my wit’s end.

=============

template = ERB.new \<\<-EOF

```
 # rsync push mode

 #rsync_push_command check

 # <%= rsync_push_command %>

 # rsync_forced_command
 # <%= rsync_forced_command %>
 #

```

EOF

some program code here

=====  
After execution the text “some program code here” appears in the  
template’s output

Are there some circumstances under which ERB goes haywire?

Is there an alternate syntax to the ERB.NEW \<\<-EOF … EOF syntax for  
when the text is on multiple lines. - Frank

---

<div class="post-metadata">

**Author:** ![vfcforums](https://www.ruby-forum.com/letter_avatar_proxy/v4/letter/v/85e7bf/32.png) [@vfcforums](https://www.ruby-forum.com/u/vfcforums)\
**Post date:** [July 21, 2007, 10:19pm UTC](https://www.ruby-forum.com/t/help-needed-with-this-erb-code/110039/2 "2007-07-21T22:19:30Z")

</div>

On 21/07/07, Frank C. [removed\_email\_address@domain.invalid](mailto:removed_email_address@domain.invalid) wrote:

> ```
> # rsync push mode
> 
> ```

Is there some way the ERB internal stack or whatever can be reset  
between calls to ensure that there is nothing left in there to cause  
errors.
