-%> Error in Windows

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.

On 9/26/06, Caleb [email protected] 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

On 9/26/06, Caleb [email protected] 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…

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).

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
softiesonrails.com

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.

On 9/26/06, Jeff [email protected] wrote:

believe RMagick was just updated to fix this problem, but I don’t know
about Ferret.

Jeff
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

This forum is not affiliated to the Ruby language, Ruby on Rails framework, nor any Ruby applications discussed here.

| Privacy Policy | Terms of Service | Remote Ruby Jobs