Advice needed --- Best way to get mysql2 gem installed to interact with Mysql Database?

Hi Group,
I’ve got mysql database installed and the server running on a Mac Pro with latest mountain lion setup 10.8.3.

I’m able to use mysql tools like mysql, mysqladmin to converse with it. :}

I use RVM’s scripts to fetch gems.

I’ve visited RVM’s website but their advise to get “mysql gem loaded” does the same thing as below aborted output!

I’m not sure that this website is being maintained anymore as their copyright notice is 2011.

What/how suggestions appreciated to get this mysql2 gem installed so that i can use rails/ruby against this database?

My ROR config:

ruby 1.9.3p194 (2012-04-20 revision 35410) [x86_64-darwin12.2.0]

Rails 3.2.12

RVM gem managed

So far Macport seems to work to install mysql and gen/install the mysql2 gem. I’ve not tried this gem yet as i’m still using RVM.

I don’t believe this is the latest mysql release by Macport.

It goes against Mysql’s website advise to install it by DMG route for Mac which I did with the latest stable 64 bit libraries/server.

Thanks for your help in trying to resolve this issue.


The aborted output from gem install mysql2.

Both ways attempted: gem install mysql2 and with the option --with-mysql-config=/usr/local/mysql/bin/mysql_config

gem install mysql2 – --with-mysql-config=/usr/local/mysql/bin/mysql_config

Building native extensions. This could take a while…

ERROR: Error installing mysql2:

ERROR: Failed to build gem native extension.

/Users/bone_david/.rvm/rubies/ruby-1.9.3-p194/bin/ruby extconf.rb --with-mysql-config=/usr/local/mysql/bin/mysql_config

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