[lnkForumImage]
TotalShareware - Download Free Software

Confronta i prezzi di migliaia di prodotti.
Asp Forum
 Home | Login | Register | Search 


 

Forums >

comp.lang.ruby

tabs and parse errors with Ruby 1.8.4 and Windows

Will Rogers

10/6/2006 2:07:00 PM

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-...topic/82...

Thanks,

- Will

--
Posted via http://www.ruby-....

18 Answers

Tim Hunter

10/6/2006 2:46:00 PM

0

Will Rogers wrote:
> 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/82...
>
> 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.rub....



Will Rogers

10/6/2006 2:49:00 PM

0

Timothy Hunter wrote:
> 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

--
Posted via http://www.ruby-....

Ara.T.Howard

10/6/2006 2:59:00 PM

0

Tim Hunter

10/6/2006 3:35:00 PM

0

ara.t.howard@noaa.gov wrote:
> On Fri, 6 Oct 2006, Timothy Hunter wrote:
>
>> 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.rub....
>
> 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.

Ara.T.Howard

10/6/2006 3:57:00 PM

0

Curt Hibbs

10/6/2006 3:59:00 PM

0

On 10/6/06, Tim Hunter <sastph@sas.com> wrote:
> ara.t.howard@noaa.gov wrote:
> > On Fri, 6 Oct 2006, Timothy Hunter wrote:
> >
> >> 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.rub....
> >
> > 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.

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

Wilson Bilkovich

10/6/2006 5:27:00 PM

0

On 10/6/06, Will Rogers <wjrogers@terpalum.umd.edu> wrote:
> 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.

David Balmain

10/6/2006 6:28:00 PM

0

On 10/7/06, Wilson Bilkovich <wilsonb@gmail.com> wrote:
> On 10/6/06, Will Rogers <wjrogers@terpalum.umd.edu> wrote:
> > 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.
>

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

Ara.T.Howard

10/6/2006 6:56:00 PM

0

Wilson Bilkovich

10/6/2006 7:41:00 PM

0

On 10/6/06, ara.t.howard@noaa.gov <ara.t.howard@noaa.gov> wrote:
> On Sat, 7 Oct 2006, David Balmain wrote:
>
> > On 10/7/06, Wilson Bilkovich <wilsonb@gmail.com> wrote:
> >> On 10/6/06, Will Rogers <wjrogers@terpalum.umd.edu> wrote:
> >> > 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.
> >>
> >
> > 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...
>

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