MySQL 5.5 + Rails + Mysql Gem + Snow Leopard

Just spend two hours trying to figure out why the MySQL 5.5 did not want to work with the mysql gem and rails.

Kept getting this error message:

uninitialized constant MysqlCompat::MysqlRes

Apparently this is a very common problem and this is probably my third time facing this. Here are some solutions

  1. sudo env ARCHFLAGS=”-arch x86_64″ gem install mysql (source)
  2. install xcode (source)
  3. uninstall mySQL 5.5, install mySQL 5.1 instead. (this worked for me)