Friday, August 30, 2013

[NoteToSelf] Installing mysql2 gem on Mac OS X

Simples, follow steps as below -

  1. Edit the file /usr/local/mysql/bin/mysql_config (user is root, so sudo it), and replace the lines 119-120 (defining cflags and cxxflags) as below -

  2. Install the mysql2 gem
  3. $ gem install mysql2
  4. Link the required mysql.h library
  5. $ sudo ln -s /usr/local/mysql/lib/libmysqlclient.18.dylib /usr/lib/libmysqlclient.18.dylib
  6. No more steps. Thank you God and http://www.randomactsofsentience.com/2013/05/gem-install-mysql2-missing-mysqlh-on-os.html
Update - If the above tip doesn't work, look into mkmf.log file generated while building the native gem.

1 comment: