新安装的操作系统5.4;干净安装percona xtradb服务器(服务器版本:5.1.56-rel12.7 Percona Server(GPL),12.7,修订版224)gem install mysql输出失败
/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 ***
这似乎表明它无法找到开发库。我知道我通常会使用其他选项--with-mysql-lib = ...但我不相信它们是作为此处概述的正常percona安装的一部分安装的:percona repositories info
所以我尝试了yum install mysql-devel,但与percona的东西发生冲突。我found this post建议的解决方案使用--with-mysql-config选项。 Percona在安装时不会自动在/etc/my.cnf上安装my.cnf,所以我把它打了一个并放在那里,因为这是mysql的init.d脚本检查它的地方。重新启动mysql,确认它现在正在加载该配置并再次尝试安装,但仍然以
失败 "Exec format error - /etc/my.cnf --cflags (Errno::ENOEXEC)"
感谢您的帮助
我也做了一个find / -name mysql.h,没有任何东西,所以看起来安装percona服务器和yum客户端后所需的库不存在
答案 0 :(得分:4)
如果您正确添加了 Percona yum存储库,则只需安装Percona-Server-devel
包:
yum install Percona-Server-devel-55
将55替换为您当前使用的Percona Server版本。
之后,mysql gems将正确安装。
答案 1 :(得分:0)
我从Percona重新安装了libmysqlclient-dev。
然后重新安装mysql& mysql2 gems。
答案 2 :(得分:0)
经过几个小时,几个小时和几个小时的麻烦:
使用percona 5.6发现以下内容安装mysql gem:
http://www.percona.com/doc/percona-server/5.6/release-notes/Percona-Server-5.6.16-64.1.html
gem uninstall mysql
apt-get删除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 - 它有效!
答案 3 :(得分:0)
对于任何尝试安装此gem的新人(此问题在搜索排名中显示得很高),请确保您已通过mysql目录,例如:
gem install mysql2 -- --with-mysql-dir=/usr/local/mysql