Spaces, not tabs 3

Posted by brian Thursday, April 27, 2006 21:58:00 GMT

Here’s just another one of these learn-it-the-hard-way tips. After upgrading to Ruby 1.8.4 and Rails 1.1, my project just died. A quick consult of my uncle Google revealed that it’s best to not use tabs at all in your code. (Most of you probably already know that tabs are a no-no in YAML as well). Many text editors, including the one I use, UltraEdit, allow you to configure your tabs as spaces, so it should be an easy fix for most folks.

I don’t know how many people are having this problem, but just to throw it out there… if you’re getting errors like:

Invalid char `\002' in expression

Sweep through your code and hunt down those rogue tab characters.

Comments

Leave a response

  1. Marcel   April 28, 2006 @ 07:56 AM

    I've been having the same problem since upgrading to Rails 1.1, but it only seems to affect me on my Windows development machine. I had no problems with it under Linux for some reason.

  2. Jeff Cole   August 01, 2006 @ 09:27 PM

    We are having the same problem with Rails on Windows. Isn't there any other solution besides replacing the tab characters? And do you know if this is because of Ruby or Rails?

  3. Jeff   August 02, 2006 @ 06:14 PM

    Jeff, any chance you're using RMagick with Ruby 1.8.4? I just ran into a big problem this week with that combination. Apparently there are some compiler issues (RMagick was compiled with one compiler, and the Ruby from the OCI was not).

    I had to roll back to 1.8.2 and reinstall all my gems to get it to work.

    Here's a thread that helped confirm my suspicions: http://rubyforge.org/tracker/index.php?func=detail&aid=4036&group_id=12&atid=133

    Wish I could suggest a workaround, but can't at the moment. And worse, 1.8.4 is recommended over 1.8.2 if you're using Rails >= 1.1.

Comment


(won't be published)