–@@@– showing up in development_structure.sql (plus a solution)

I recently wiped my laptop clean & upgraded to snow leopard (OS X v10.6). In doing so I had to reinstall all my apps including gems, libraries, drivers, frameworks, etc.

One of my projects is a Rails application that uses a oracle database. I installed the latest version of the required gems (including activerecord-oracle_enhanced-adapter) and found that things seemed to work fine at first, but eventually I ran a migration followed by rake db:test:clone_structure & found that things where not working as expected…. in particular the generated development_structure.sql file contained __@@@__ where it should contain semicolons, making things break all over the place:

$ rake db:test:clone_structure
(in /Users/smcpherson/dev/awesome_project)
Exporting Synonyms
Exporting Primary Key Constraints
Exporting Foreign Key Constraints
Exporting Triggers
rake aborted!
OCIError: ORA-00900: invalid SQL statement: –@@@–

I don’t know what was causing this, but I know how I eventually avoided the problem….

First, I removed the latest version of activerecord-oracle_enhanced-adapter (1.2.4):

sudo gem install activerecord-oracle_enhanced-adapter

Then installed the 1.2.3, 64 bit:

sudo env ARCHFLAGS=”-arch x86_64″ gem install activerecord-oracle_enhanced-adapter -v=1.2.3

That’s it.

The 64 bit thing was not a issue — but I specified that as I don’t need the 32 bit version & from what I understand I will get a 32 & 64 bit version unless I specify the ARCHFLAGS during the gem install.

Hope this helps someone else as it consumed the better part of my day….