Today, i spent way too much time to install the mysql2 gem. Here’s the command that worked fine

ARCHFLAGS="-arch x86_64" gem install mysql2 -v '0.3.11' -- \ --with-mysql-config=/usr/local/bin/mysql_config