Reputation: 2741
New install of cent os 5.4; clean install of percona xtradb server (Server version: 5.1.56-rel12.7 Percona Server (GPL), 12.7, Revision 224) gem install mysql failed with the output
/usr/local/rvm/rubies/ruby-1.9.2-p180/bin/ruby extconf.rb
checking for mysql_query() in -lmysqlclient... yes
checking for mysql_ssl_set()... yes
checking for rb_str_set_len()... yes
checking for rb_thread_start_timer()... no
checking for mysql.h... no
checking for mysql/mysql.h... no
*** extconf.rb failed ***
which appears to indicate it can't find the dev libraries. I know I'd normally use the additional options -- --with-mysql-lib=... but I don't believe they're installed as part of the normal percona install outlined here: percona repositories info
So I tried doing yum install mysql-devel but get a conflict with the percona stuff. I found this post where the proposed solution was using the --with-mysql-config option. Percona doesn't automatically install a my.cnf at /etc/my.cnf upon installation, so I whipped one up and placed it there because that's where the init.d script for mysql checks for it. Restarted mysql, confirmed that it's now loading that configuration and attempted the install again, but still failed with
"Exec format error - /etc/my.cnf --cflags (Errno::ENOEXEC)"
Thanks for any help
I also did a find / -name mysql.h and nothing, so it looks like the required libraries are not present after installing both percona server and client with yum
Upvotes: 1
Views: 2859
Reputation: 4287
For any new people trying to install this gem (this question shows up highly in search ranks), make sure you're passing the mysql directory, like:
gem install mysql2 -- --with-mysql-dir=/usr/local/mysql
Upvotes: 0
Reputation: 1
After troubling hours and hours and many hours:
Found the following to install mysql gem with percona 5.6:
http://www.percona.com/doc/percona-server/5.6/release-notes/Percona-Server-5.6.16-64.1.html
gem uninstall mysql
apt-get remove mysql-server mysql-server-5.5 mysql-client mysql-client-5.5 mysql-client-core-5.5 mysql-server-core-5.5 mysql-common libmysqlclient18:i386 libmysqlclient18:amd64
apt-get install percona-server-server-5.6 percona-server-client-5.6
cd /usr/lib/x86_64-linux-gnu
mv libmysqlclient.so.18.0.0 libmysqlclient.so.18.0.0-backup
ln -s libperconaserverclient.so.18.1.0 libmysqlclient.so.18.0.0
rm -rf /home/slat/.rvm/gems/ruby-XXXXX/gems/mysql*
gem install mysql
YIHAA - It works!
Upvotes: 0
Reputation: 56
If you correctly added Percona yum repository you just need to install the Percona-Server-devel
package:
yum install Percona-Server-devel-55
Replace 55 with the Percona Server version you're currently using.
After that, mysql gems will install correctly.
Upvotes: 4
Reputation: 787
I've reinstalled libmysqlclient-dev from Percona.
And then reinstalled mysql & mysql2 gems.
Upvotes: 0