Data Objects do_mysql with x86_64 MySQL Install

Ran into this problem today installing do_mysql on my OSX machine that is running on 8GB of RAM. I installed the x86_64 version of MySQL as I wanted to be able to address that amount of RAM. I originally had installed do_mysql by issuing the command:

sudo env ARCHFLAGS=”-arch x86_64″ gem install do_mysql — –with-mysql-dir=/usr/local/mysql

The install went fine, or so I thought. When trying to use the adapter in my latest Sinatra app, I was getting an error complaining about:

dlopen(/Library/Ruby/Gems/1.8/gems/do_mysql-0.9.11/lib/do_mysql_ext.bundle, 9): no suitable image found.  Did find:

/Library/Ruby/Gems/1.8/gems/do_mysql-0.9.11/lib/do_mysql_ext.bundle: mach-o, but wrong architecture – /Library/Ruby/Gems/1.8/gems/do_mysql-0.9.11/lib/do_mysql_ext.bundle

The solution? Reinstall the do_mysql gem with the following 2 commands

PATH=$PATH:/usr/local/mysql

sudo gem install do_mysql


Leave a Reply