Instale mysql2 ruby ​​gem no OS X 10.8 Mountain Lion – Ruby + MacPorts

Eu tropecei no seguinte problema:

Installing mysql2 (0.3.11) with native extensions 
Gem::Installer::ExtensionBuildError: ERROR: Failed to build gem native extension.

/Users/gergely/.rvm/rubies/ruby-1.9.3-p194/bin/ruby extconf.rb
checking
for rb_thread_blocking_region()... yes
checking
for rb_wait_for_single_fd()... yes
checking
for mysql.h... no
checking
for mysql/mysql.h... no
-----
mysql
.h is missing. please check your installation of mysql and try again.
-----
*** extconf.rb failed ***
Could not create Makefile due to some reason, probably lack of
necessary libraries
and/or headers. Check the mkmf.log file for more
details
. You may need configuration options.

Primeiro, instale o MySQL via MacPorts:

sudo port install mysql55 mysql55-server

Em seguida, instale a gem do MySQL com a configuração adequada:

sudo gem install mysql2 -- --with-mysql-config=/opt/local/lib/mysql55/bin/mysql_config

Resultado:

Building native extensions.  This could take a while...
Successfully installed mysql2-0.3.11
1 gem installed
Installing ri documentation for mysql2-0.3.11...
Installing RDoc documentation for mysql2-0.3.11...

Ganhar!