gem mysql 2.7 on CentOS 5.2 x86_64
Just a quick note for better Google results: compiling the native mysql gem on a x86_86 CentOS 5.2 machine isn’t quite straightforward. The following error message is displayed:
/usr/bin/ruby extconf.rb install --no-ri --no-rdoc \
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... yes
checking for mysql_query() in -lmysqlclient... no
*** extconf.rb failed ***
...
Seems the gem builder wouldn’t find my installed mysql header files. Now how to pass the correct location to gem? Google found me a site that describes the same problem on Mac OS X.Transformed to CentOS x86_64, the command would be:
ARCHFLAGS="-arch x86_64" gem install --no-ri --no-rdoc mysql -- --with-mysql-config=/usr/bin/mysql_config
-
Posted by carp on March 4th, 2009 filed in Computers, Linux, Ruby | 1 Comment »

October 26th, 2010 at 12:48 pm
[...] up a new server, I’ve run into another gem building problem (similar to a problem with the mysql gem on a Centos 5.2 system a while back). The amatch gem fails to build its native part on a 64bit Ubuntu, terminating with: [...]