tabs and parse errors with Ruby 1.8.4 and Windows

W

Will Rogers

This is a cross-post from the Rails list in hopes of getting some
information from people who know more about the Ruby side of things.

I get compile errors from ERB in my Rails views when I load the ferret C
extension. Apparently this also happens with RMagick. The most common
response I've seen is to replace all tabs with spaces, and the problem
will go away. I would like to know why that works, what the problem is,
and if there's anything I can do to fix it. Making sure none of my views
contain tab characters is not a solution I'm comfortable with for a
production environment. This is what the errors look like:

compile error
/script/../config/../app/views/search/query.rhtml:5: Invalid char
`\002' in expression
/script/../config/../app/views/search/query.rhtml:6: parse error,
unexpected tIDENTIFIER, expecting kEND
_erbout.concat " <strong>"xP; _erbout.concat(( "%d%%" % (result.RANK /
1000.0 * 100) ).to_s); _erbout.concat "</strong>\n"
^
/script/../config/../app/views/search/query.rhtml:7: parse error,
unexpected $, expecting kEND

I have tried recompiling everything (Ruby, extensions, zlib, and ferret)
myself, and only using the precompiled binaries for readline.dll and
iconv.dll because I can't find the source for the Windows ports
anywhere. That made no difference, so I was thinking it was a Ruby bug
(since it happened with two different extensions), but I guess it could
be something odd both extensions are doing, too. Other people reporting
this problem have indicated it started with Ruby 1.8.4.

See the Rails thread for more details:
http://www.ruby-forum.com/topic/82955#146645

Thanks,

- Will
 
T

Timothy Hunter

Will said:
This is a cross-post from the Rails list in hopes of getting some
information from people who know more about the Ruby side of things.

I get compile errors from ERB in my Rails views when I load the ferret C
extension. Apparently this also happens with RMagick. The most common
response I've seen is to replace all tabs with spaces, and the problem
will go away. I would like to know why that works, what the problem is,
and if there's anything I can do to fix it. Making sure none of my views
contain tab characters is not a solution I'm comfortable with for a
production environment. This is what the errors look like:

compile error
./script/../config/../app/views/search/query.rhtml:5: Invalid char
`\002' in expression
./script/../config/../app/views/search/query.rhtml:6: parse error,
unexpected tIDENTIFIER, expecting kEND
_erbout.concat " <strong>"xP; _erbout.concat(( "%d%%" % (result.RANK /
1000.0 * 100) ).to_s); _erbout.concat "</strong>\n"
^
./script/../config/../app/views/search/query.rhtml:7: parse error,
unexpected $, expecting kEND

I have tried recompiling everything (Ruby, extensions, zlib, and ferret)
myself, and only using the precompiled binaries for readline.dll and
iconv.dll because I can't find the source for the Windows ports
anywhere. That made no difference, so I was thinking it was a Ruby bug
(since it happened with two different extensions), but I guess it could
be something odd both extensions are doing, too. Other people reporting
this problem have indicated it started with Ruby 1.8.4.

See the Rails thread for more details:
http://www.ruby-forum.com/topic/82955#146645

Thanks,

- Will
You don't say what version of RMagick you're using but I'm assuming it's
1.9.2. There was a problem having this symptom when using RMagick 1.9.2
with Ruby 1.8.4 because RMagick was compiled using a different compiler
than Ruby. The rmagick-win32 gem, version 1.13.0, is compatible with
Ruby 1.8.4. There is also a version of the rmagick-win32 gem for Ruby
1.8.5. Both are available from RubyForge: http://rmagick.rubyforge.org.
 
W

Will Rogers

Timothy said:
You don't say what version of RMagick you're using but I'm assuming it's

Timothy,

I didn't say what version of RMagick I'm using because I'm not using
RMagick. Also, I recompiled everything involved from scratch, so there
is no issue of differing Ruby versions.

- Will
 
A

ara.t.howard

You don't say what version of RMagick you're using but I'm assuming it's
1.9.2. There was a problem having this symptom when using RMagick 1.9.2 with
Ruby 1.8.4 because RMagick was compiled using a different compiler than Ruby.
The rmagick-win32 gem, version 1.13.0, is compatible with Ruby 1.8.4. There
is also a version of the rmagick-win32 gem for Ruby 1.8.5. Both are available
from RubyForge: http://rmagick.rubyforge.org.

can you elaborate tim?

-a
 
T

Tim Hunter

can you elaborate tim?

-a

Of course, Ara.

Kaspar Schiess, the RMagick Win32 guru, compiled RMagick 1.9.2 for Ruby
1.8.2 using mingw. This worked fine since the 1-click installer for Ruby
1.8.2 was compiled with VC++2003 (iirc, I don't know much about MS
compiler versions). Curt switched to VC6 (VC++2005?) for the Ruby 1.8.4
1-click installer. The binaries produced by mingw are not compatible
with the VC6 binaries, so as soon as RMagick users (mostly Rails folks)
switched to Ruby 1.8.4 they started having problems. Usually the
problems had the symptom described in this thread.

Brett DiFrischia, RMagick's new Win32 ninja, compiled the RMagick 1.13.0
gem for Windows using a compiler that is compatible with the 1.8.4
1-click installer. I think he posted the details on this list, if not
I'm sure he'd be happy to explain.

There was a lot of discussion on this list about which compiler to use
for the 1-click installer a couple of months ago. The decision directly
affects all binary extensions for Windows. I'm pulling for mingw since
it's free (as in FOSS). There are also good arguments for an MS
compiler. I don't think Curt's made a decision yet.
 
A

ara.t.howard

Of course, Ara.

Kaspar Schiess, the RMagick Win32 guru, compiled RMagick 1.9.2 for Ruby
1.8.2 using mingw. This worked fine since the 1-click installer for Ruby
1.8.2 was compiled with VC++2003 (iirc, I don't know much about MS compiler
versions). Curt switched to VC6 (VC++2005?) for the Ruby 1.8.4 1-click
installer. The binaries produced by mingw are not compatible with the VC6
binaries, so as soon as RMagick users (mostly Rails folks) switched to Ruby
1.8.4 they started having problems. Usually the problems had the symptom
described in this thread.

Brett DiFrischia, RMagick's new Win32 ninja, compiled the RMagick 1.13.0 gem
for Windows using a compiler that is compatible with the 1.8.4 1-click
installer. I think he posted the details on this list, if not I'm sure he'd
be happy to explain.

There was a lot of discussion on this list about which compiler to use for
the 1-click installer a couple of months ago. The decision directly affects
all binary extensions for Windows. I'm pulling for mingw since it's free (as
in FOSS). There are also good arguments for an MS compiler. I don't think
Curt's made a decision yet.

thanks alot tim. i for one, am also pulling for an mingw compiler.

kind regards.

-a
 
C

Curt Hibbs

Of course, Ara.

Kaspar Schiess, the RMagick Win32 guru, compiled RMagick 1.9.2 for Ruby
1.8.2 using mingw. This worked fine since the 1-click installer for Ruby
1.8.2 was compiled with VC++2003 (iirc, I don't know much about MS
compiler versions). Curt switched to VC6 (VC++2005?) for the Ruby 1.8.4
1-click installer. The binaries produced by mingw are not compatible
with the VC6 binaries, so as soon as RMagick users (mostly Rails folks)
switched to Ruby 1.8.4 they started having problems. Usually the
problems had the symptom described in this thread.

Brett DiFrischia, RMagick's new Win32 ninja, compiled the RMagick 1.13.0
gem for Windows using a compiler that is compatible with the 1.8.4
1-click installer. I think he posted the details on this list, if not
I'm sure he'd be happy to explain.

There was a lot of discussion on this list about which compiler to use
for the 1-click installer a couple of months ago. The decision directly
affects all binary extensions for Windows. I'm pulling for mingw since
it's free (as in FOSS). There are also good arguments for an MS
compiler. I don't think Curt's made a decision yet.

You are correct, no decision has been made yet. We just began talks
with Microsoft developers who are on the Visual Studio team. We need
to see what comes out of that before making any decisions.

Curt
 
W

Wilson Bilkovich

This is a cross-post from the Rails list in hopes of getting some
information from people who know more about the Ruby side of things.

I get compile errors from ERB in my Rails views when I load the ferret C
extension. Apparently this also happens with RMagick. The most common
response I've seen is to replace all tabs with spaces, and the problem
will go away. I would like to know why that works, what the problem is,
and if there's anything I can do to fix it. Making sure none of my views
contain tab characters is not a solution I'm comfortable with for a
production environment. This is what the errors look like:

Just chiming in to say that I get these as well. I've just been
search-and-replacing tabs with spaces, rather than bothering to get to
the bottom of it.
 
D

David Balmain

Just chiming in to say that I get these as well. I've just been
search-and-replacing tabs with spaces, rather than bothering to get to
the bottom of it.

I'd love to know what is causing this problem. I tried reproducing it
here but I couldn't. Even installing an older version of the one-click
installer didn't help. Ferret still ran fine and tabs didn't seem to
do anything. What is is about tab characters anyway?

Anyway, I'm still looking into it. I might try and get my hands on a
few other systems to test on.

Cheers,
Dave
 
A

ara.t.howard

I'd love to know what is causing this problem. I tried reproducing it
here but I couldn't. Even installing an older version of the one-click
installer didn't help. Ferret still ran fine and tabs didn't seem to
do anything. What is is about tab characters anyway?

Anyway, I'm still looking into it. I might try and get my hands on a
few other systems to test on.

Cheers,
Dave

i'm guessing a different def if isspace or issacii - i've seen issues with
those before with mingw vs ms compilers...

-a
 
W

Wilson Bilkovich

i'm guessing a different def if isspace or issacii - i've seen issues with
those before with mingw vs ms compilers...

Yeah. I'm not using the one-click installer here, but rather the
mswin32 build it is based on. Good times.. good times..
 
W

Will Rogers

David said:
I'd love to know what is causing this problem. I tried reproducing it
here but I couldn't. Even installing an older version of the one-click

Are you using a Rails application to test? It only happens for me in
Rails views, not in irb or regular Ruby scripts.
Anyway, I'm still looking into it. I might try and get my hands on a
few other systems to test on.

I just installed the Cygwin version of Ruby to test that combination,
and it works fine running WEBrick from Cygwin's Ruby. No compile errors.
So it's apparently a problem with Microsoft compilers only. At this
point, I'm considering building Ruby using mingw just to get this
working.

That doesn't address the problem of it not working in the official
mswin32 binary release of Ruby. From a maintenance standpoint, it's
pretty important to me that this get cleared up :)

Thanks for looking into it, David.

- Will
 

Ask a Question

Want to reply to this thread or ask your own question?

You'll need to choose a username for the site, which only take a couple of moments. After that, you can post your question and our members will help you out.

Ask a Question

Members online

No members online now.

Forum statistics

Threads
473,769
Messages
2,569,579
Members
45,053
Latest member
BrodieSola

Latest Threads

Top