Unexpected “parse error, unexpected tINTEGER Object” Error
By chris on February 22nd 2007 in /dev/rails | 717 views
Tonight I got this error when executing a .find( :all ) on a seemingly innocuous database table:
compile error
/usr/local/lib/ruby/gems/1.8/gems/activerecord-1.15.2/lib/active_record/base.rb:1359: parse error, unexpected tINTEGER Object::3
After a bit of bashing about I figured out that this was because I’d named one of the fields in the table as type.
The moral of the story: don’t name table fields type or Rails will puke on you. So, are there other not-recommended field names?

Edd responded on 11 Mar 2007 at 1:47 pm #
I love you. I’ve been spending hours trying to figure this out, and a random search across the interweb found this.
We shall spread the word! The sanity of developers across the globe depend on us.
chris responded on 11 Mar 2007 at 2:40 pm #
Glad I could be of help
Marcus Floriano responded on 13 Mar 2007 at 8:08 pm #
Hi,
I had the same problem, it could never imagine that this was problem.
Thank you very much.
Jason Cabot responded on 04 Jul 2007 at 2:59 am #
Hi,
Thank You, Thank You, Thank You…
It’s just a pity that rails doesn’t make things like this more obvious
- From that error I would never have thought that the problem was with a column name!!
tayfun responded on 20 Nov 2007 at 5:41 pm #
Thanks a bunch. I couldn’t see this was the problem.
Igor responded on 03 Mar 2008 at 3:07 pm #
Thanks you very much!
You saved a lot of my time!
Do not name table columns “type” in Rails « SNBlog responded on 14 Mar 2008 at 1:01 pm #
[...] March 14, 2008 Or error emissions ensue: Chris tells you why. [...]