Problem With Mysql2 Gem Installation on Lion

Yesterday I tried to install gem mysql2 but it complained to missing libraries.

After installation of macports I tried with sudo port install mysql5-devel to install libraries but it failed again.

The problem is in gcc compiler so after some searching on google I found solution on this site.

In short solution is in these 2 commands where you do cleanup of mysql5-devel and then build with llvm-gcc compiler.

1
2
sudo port clean mysql5-devel
sudo port install mysql5-devel configure.compiler=llvm-gcc-4.2