I know this has been asked several times, but I searched and I tried many different things and nothing worked.
ERROR: Error installing mysql2:
ERROR: Fa
This blog post solved a similar if not the same problem that I was having.
You need to install libmysqlclient-dev in order to build the mysql2 gem.
I had the exact same problems. I resolved them by uninstalling MySQL completely, reinstalling the 64 bit version and installing the mysql2 gem with options pointing to the MySQL install.
I followed some instructions I found at petermac.com:
1. Uninstall MySQL:
sudo rm /usr/local/mysql
sudo rm -rf /usr/local/mysql*
sudo rm -rf /Library/StartupItems/MySQLCOM
sudo rm -rf /Library/PreferencePanes/My*
edit /etc/hostconfig and remove the line MYSQLCOM=-YES-
sudo rm -rf /Library/Receipts/mysql*
sudo rm -rf /Library/Receipts/MySQL*
2. Install MySQL 64 bit edition
3. Install mysql2 gem
sudo env ARCHFLAGS="-arch x86_64" gem install mysql2 -- \
--with-mysql-dir=/usr/local/mysql --with-mysql-lib=/usr/local/mysql/lib \
--with-mysql-include=/usr/local/mysql/include
That should at least get the gem installed :)