Tab characters with Rails 1.1 on Windows

We just upgraded to Ruby 1.8.4 and Rails 1.1. It works fine on my Mac
OSX, but in Windows, Rails spits out errors like “Invalid char `\002’ in
expression”. Apparently, Ruby or Rails on Windows has a problem parsing
tab characters. This seems to be a common problem:
http://softiesonrails.com/articles/2006/04/27/spaces-not-tabs

However, the only recommended solutions seems to be to replace all the
tabs with spaces in your entire source tree. Is there a different
solution? And does anyone know exactly why this is happening?

thanks,
Jeff

I’d be interested to hear if there is an easy solution as well. I’ve
just been using an automated find and replace to strip them all, but
haven’t seen any documentation on a true solution yet…

Jeff C. wrote:

We just upgraded to Ruby 1.8.4 and Rails 1.1. It works fine on my Mac
OSX, but in Windows, Rails spits out errors like “Invalid char `\002’ in
expression”. Apparently, Ruby or Rails on Windows has a problem parsing
tab characters. This seems to be a common problem:
http://softiesonrails.com/articles/2006/04/27/spaces-not-tabs

However, the only recommended solutions seems to be to replace all the
tabs with spaces in your entire source tree. Is there a different
solution? And does anyone know exactly why this is happening?

thanks,
Jeff

I received an email that sheds some light on this. Apparently, it has
to do with RMagick and 1.8.4. Guess this thread should be on a
different list, but I thought I’d follow up for those who might be
effected:

Are you using RMagick? There is a known issue which causes the invalid
character problem in the Rmagick port for windows when used with ruby
1.84.
This is causing me some headaches, too. In terms of fixes, per Kaspar,
the
developer for the Win32 port of RMagick, the earliest something will be
ready is September. See the thread here:

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

I’m currently exploring two avenues:

1 - Whether using mini_magick will avoid this (I’m not sure whether
minimagick uses rmagick under the hood)

Here is an example app with source by Geoffrey Grosenbach that uses
MiniMagick. Again, don’t know if this avenue will be fruitful yet.
http://nubyonrails.com/pages/gullery

2- Using IMLIB2, which I found out about from a gentleman named Doug
Alcorn,
whose blog is found here:

http://blog.lathi.net/articles/category/ruby-on-rails/page/4

Doug emailed me some source. Since I only asked for myself, I don’t
want to
share his code without permission. If you ask nicely, maybe he’ll send
it
to you, or put it up on his blog as I’m sure others will run into this
too.
Feel free to post this info on the mailing list. I get the list in
digest
form, and for whatever reason, wasn’t able to get my posting to work, so
I
thought I’d email you directly. Thanks,

Eric B.

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