# \-%\> Error in Windows

**URL:** <https://www.ruby-forum.com/t/error-in-windows/69970>\
**Category:** Rails\
**Created:** [September 26, 2006, 12:22am UTC](https://www.ruby-forum.com/t/error-in-windows/69970 "2006-09-26T00:22:10Z")\
**Posts on this page:** 7\
**Page:** 1

<div class="post-metadata">

**Author:** ![casper\_the\_ghost](https://www.ruby-forum.com/letter_avatar_proxy/v4/letter/c/58956e/32.png) [@casper\_the\_ghost](https://www.ruby-forum.com/u/casper_the_ghost)\
**Post date:** [September 26, 2006, 12:22am UTC](https://www.ruby-forum.com/t/error-in-windows/69970/1 "2006-09-26T00:22:10Z")

</div>

I frequently use \<% “foobar” -%\> syntax (note the closing -%\>) to  
prevent extra newlines from being rendered to the page when my template  
files have logic. This works fine in ruby 1.8.4 (2005-12-24)  
[i686-linux]. But in ruby 1.8.5 (2006-08-25) [i386-mswin32] this causes  
a “parse error, unexpected $, expecting kEND” error. Was the ability to  
use " -%\>" to prevent extra newlines removed from version 1.8.4 to  
1.8.5? Or is this a Linux/Windows issue?

Has anyone else run into this? I would just like to know so I can get  
out of the habbit of using “-%\>” if it is no longer supported.

---

<div class="post-metadata">

**Author:** ![casper\_the\_ghost](https://www.ruby-forum.com/letter_avatar_proxy/v4/letter/c/58956e/32.png) [@casper\_the\_ghost](https://www.ruby-forum.com/u/casper_the_ghost)\
**Post date:** [September 26, 2006, 12:42am UTC](https://www.ruby-forum.com/t/error-in-windows/69970/2 "2006-09-26T00:42:11Z")

</div>

On 9/26/06, Caleb [removed\_email\_address@domain.invalid](mailto:removed_email_address@domain.invalid) wrote:

> Has anyone else run into this? I would just like to know so I can get  
> out of the habbit of using “-%\>” if it is no longer supported.

I use -%\> all the time on Windows. I think I’ve seen this error before  
though when there are tabs in the .rhtml file.

If you convert these to spaces you might have some luck.

Cheers

---

<div class="post-metadata">

**Author:** ![casper\_the\_ghost](https://www.ruby-forum.com/letter_avatar_proxy/v4/letter/c/58956e/32.png) [@casper\_the\_ghost](https://www.ruby-forum.com/u/casper_the_ghost)\
**Post date:** [September 26, 2006, 1:32am UTC](https://www.ruby-forum.com/t/error-in-windows/69970/3 "2006-09-26T01:32:15Z")

</div>

On 9/26/06, Caleb [removed\_email\_address@domain.invalid](mailto:removed_email_address@domain.invalid) wrote:

> Sure enough, I did a search and replace for tabs and replaced them with  
> spaces. Is this a difference in the way Linux and Windows encode/read  
> tab characters? If it isn’t an encoding issue then this seems like a  
> ruby bug (since it works in one environment and not the other).

To be honest, I don’t know if it’s a difference with Linux since I don’t  
use  
it.

This was something that was pointed out to me, and I havn’t really seen  
the  
need to undestand why it can’t use tabs it up to this point. I just set  
my  
editor to use spaces instead of tabs and away I go.

Sorry I can’t be any more help to understanding why…

---

<div class="post-metadata">

**Author:** ![casper\_the\_ghost](https://www.ruby-forum.com/letter_avatar_proxy/v4/letter/c/58956e/32.png) [@casper\_the\_ghost](https://www.ruby-forum.com/u/casper_the_ghost)\
**Post date:** [September 26, 2006, 1:10am UTC](https://www.ruby-forum.com/t/error-in-windows/69970/4 "2006-09-26T01:10:13Z")

</div>

Daniel ----- wrote:

> I use -%\> all the time on Windows. I think I’ve seen this error before  
> though when there are tabs in the .rhtml file.
> 
> If you convert these to spaces you might have some luck.

Sure enough, I did a search and replace for tabs and replaced them with  
spaces. Is this a difference in the way Linux and Windows encode/read  
tab characters? If it isn’t an encoding issue then this seems like a  
ruby bug (since it works in one environment and not the other).

---

<div class="post-metadata">

**Author:** ![casper\_the\_ghost](https://www.ruby-forum.com/letter_avatar_proxy/v4/letter/c/58956e/32.png) [@casper\_the\_ghost](https://www.ruby-forum.com/u/casper_the_ghost)\
**Post date:** [September 26, 2006, 4:08am UTC](https://www.ruby-forum.com/t/error-in-windows/69970/5 "2006-09-26T04:08:21Z")

</div>

Caleb wrote:

> Sure enough, I did a search and replace for tabs and replaced them with  
> spaces. Is this a difference in the way Linux and Windows encode/read  
> tab characters? If it isn’t an encoding issue then this seems like a  
> ruby bug (since it works in one environment and not the other).

Any chance you’re using RMagick or Ferret? These have been known to  
cause Erb problems on Windows - specifically errors in your .rhtml  
files claiming that you have invalid characters in your file. I  
believe RMagick was just updated to fix this problem, but I don’t know  
about Ferret.

Jeff

> **[Hey Daddio!](http://softiesonrails.com)**
>
> Home of Hey Daddio Software

---

<div class="post-metadata">

**Author:** ![casper\_the\_ghost](https://www.ruby-forum.com/letter_avatar_proxy/v4/letter/c/58956e/32.png) [@casper\_the\_ghost](https://www.ruby-forum.com/u/casper_the_ghost)\
**Post date:** [September 26, 2006, 8:39pm UTC](https://www.ruby-forum.com/t/error-in-windows/69970/6 "2006-09-26T20:39:20Z")

</div>

Jeff C. wrote:

> Any chance you’re using RMagick or Ferret? These have been known to  
> cause Erb problems on Windows - specifically errors in your .rhtml  
> files claiming that you have invalid characters in your file. I  
> believe RMagick was just updated to fix this problem, but I don’t know  
> about Ferret.

Ya, I’m using the Ferret plugin. I’ll take a look at that.

---

<div class="post-metadata">

**Author:** ![casper\_the\_ghost](https://www.ruby-forum.com/letter_avatar_proxy/v4/letter/c/58956e/32.png) [@casper\_the\_ghost](https://www.ruby-forum.com/u/casper_the_ghost)\
**Post date:** [September 26, 2006, 10:01am UTC](https://www.ruby-forum.com/t/error-in-windows/69970/7 "2006-09-26T10:01:53Z")

</div>

On 9/26/06, Jeff [removed\_email\_address@domain.invalid](mailto:removed_email_address@domain.invalid) wrote:

> believe RMagick was just updated to fix this problem, but I don’t know  
> about Ferret.
> 
> Jeff  
> [softiesonrails.com](http://softiesonrails.com)

Unless I’m wrong (and I hope I am) the only fix applied to RMagick was  
to compile it against Ruby 1.8.4-20 stable. Ferret is already compile  
against this version so if using either of the two libraries you  
should be using version 1.8.4-20 of One-Click Ruby. Details of the  
problem are here;

```
http://rubyforge.org/tracker/index.php?func=detail&aid=3837&group_id=12&atid=133

```

Cheers,  
Dave
