Monday, August 24, 2009

Update mysql gem for rails

Had a problem updating mysql gem today... keep getting the following error:

ERROR: While executing gem ... (Gem::Installer::ExtensionBuildError)
ERROR: Failed to build gem native extension.
/System/Library/Frameworks/Ruby.framework/Versions/1.8/usr/bin/ruby extconf.rb update mysql
checking for mysql_query() in -lmysqlclient... no
checking for main() in -lm... yes
checking for mysql_query() in -lmysqlclient... no
checking for main() in -lz... yes
checking for mysql_query() in -lmysqlclient... no
checking for main() in -lsocket... no
checking for mysql_query() in -lmysqlclient... no
checking for main() in -lnsl... no
checking for mysql_query() in -lmysqlclient... no
checking for main() in -lmygcc... no
checking for mysql_query() in -lmysqlclient... no

Copied the error and googled around and found a solution. It appear to be that gem installationis not finding mysql directory correctly. However, that fix doesnot work for me as I still getting the same error after regenerated Makefile...

So, I used the very basic way: install the mysql gem, which will install the latest version for me.