The Decider said on Fri Dec 14 10:26:16 +0000 2007 | permalink
Tagged: os x gem mysql leopard

mysql gem and Leopard not playing nicely

Just installed the latest mysql for os x Leopard. Re-installed the mysql gem using:

sudo env ARCHFLAGS="-arch i386" gem install mysql -- --with-mysql-config=/usr/local/mysql/bin/mysql_config

All seemed to go well but when trying to rake test I got:

dyld: NSLinkModule() error dyld: Library not loaded: /usr/local/mysql/lib/mysql/libmysqlclient.15.dylib Referenced from: /usr/local/lib/ruby/gems/1.8/gems/mysql-2.7/lib/mysql.bundle Reason: image not found Trace/BPT trap

Crap!

The gem is looking in the wrong place for the dylib!

Fix

sudo mkdir /usr/local/mysql/lib/mysql sudo ln -s /usr/local/mysql/lib/libmysqlclient.15.dylib /usr/local/mysql/lib/mysql/libmysqlclient.15.dylib