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