I am having a problem installing the mysql2 gem.
This comes up when I do gem install mysql2
:
Marks-MacBook-Pro:~ Mark$ gem install mysql
This command worked for me:
gem install mysql2 -- --srcdir=/usr/local/mysql/include
Make sure openssl is installed on Mac via Homebrew.
brew install openssl
Install mysql2 gem.
gem install mysql2 -v '0.5.2' -- --with-ldflags=-L/usr/local/opt/openssl/lib --with-cppflags=-I/usr/local/opt/openssl/i
The following worked for me
brew install mysql
brew install mysql-connector-c
gem install mysql2
It seems that it cannot find the MySQL library. Have you installed MySQL?
Try installing it via homebrew:
brew install mysql
or install it via macports or fink or whatever you prefer.
Then try again with:
gem install mysql2
I don't need MySQL on Mac OS X, because I have MySQL installed on Vagrant box. Therefore, I just installed mysql-connector-c.
brew install mysql-connector-c
gem install mysql2
You'll have to specify some additional environment variables to install this gem on the 64 bit architecture for Mac OSX 10.6:
env ARCHFLAGS="-arch x86_64" gem install mysql2
If you are using rvm you can add this as your default option in the ~/.rvmrc file:
rvm_archflags="-arch x86_64"