uninitialized constant MysqlCompat::MysqlRes

So getting an old rails project up and running today was a bit of a problem. And it all ended up being something very simple.

If your on Snow Leopard you probably know that you have to install the mysql gem in a special way:

sudo env ARCHFLAGS="-arch x86_64" gem install mysql
  -- -with-mysql-config=/usr/local/mysql/bin/mysql_config

This is all well and good, until you rake gems:unpack. That's when it all started today.

You see, those gems have to be built. And, just like when you install the gem into your system gems, it has to know the arch settings. That means you need to do:

env ARCHFLAGS="-arch x86_64" rake gems:build

So simple, yet an entire hour lost.

Can ruby gems not do this for me?