I\'m having the exact issue as described in this question: MYSQL Installation Troubles. Unfortunately none of the answers helped me (and it\'s closed).
I try to learn
The correct gem to use is mysql2
.
I just end up with that problem using this command:
sudo env ARCHFLAGS="-arch i386" gem install --no-rdoc --no-ri mysql -v 2.8.1 -- --with-mysql-config=/usr/local/mysql/bin/mysql_config
Indeed I needed to install mysql gem version 2.8.1 on my mac OS X Leopard 10.5.8 running the mysql-5.6.2-m5-osx10.5-x86 from dmg file. I had the issue that it couldn't find libraries and I made some manipulations, then it couldn't install because of permissions. I found out that command, added the version I needed and changed architecture to the one corresponding to my mysql installation.
So if somenone still wants to install that version :) let's try ! But we are not a lot installing this probably, and less on Leopard!
In order to install the MySQL gem on OS X, you need to install the XCode developer tools that come on your installation disk. You can also download them from http://developer.apple.com.
for some reason (maybe because i'm using rubygems 1.3.7 or installing mysql-2.8.1)
sudo gem install mysql -- --with-mysql-config=/usr/local/mysql/bin/mysql_config
did not work for me so after taking a look at gems/mysql-2.8.1/ext/mysql_api/extconf.rb i found out that the extconf.rb looks in the PATH for mysql_config so i tried
export PATH=$PATH:/usr/local/mysql/bin
sudo gem install mysql
and did the job
Are you on snow leopard? You have to execute the C dependencies compiles with x64 headers, try:
sudo env ARCHFLAGS="-arch x86_64" gem install mysql -- --with-mysql-config=/usr/local/mysql/bin/mysql_config
I have run into issues with the MySQL gem myself and these are the only 2 links I actually bookmarked, so one of should have actually worked for me. Thought I'd share.
The second one is kind of old, so not sure if it still applies.