需要帮助获取mysql2安装。我搜遍了所有,都感到沮丧。我是个新手,并不断遇到某些障碍。我已经设法过去了,但我正在寻求帮助。我得到以下运行 创业板安装mysql2Gem mysql2安装
[root bin]# gem install mysql2
Building native extensions. This could take a while...
ERROR: Error installing mysql2:
ERROR: Failed to build gem native extension.
/usr/bin/ruby extconf.rb
checking for ruby/thread.h... no
checking for rb_thread_blocking_region()... no
checking for rb_wait_for_single_fd()... no
checking for rb_hash_dup()... no
checking for rb_intern3()... no
-----
Using mysql_config at /usr/bin/mysql_config
-----
checking for mysql.h... no
checking for mysql/mysql.h... no
-----
mysql.h is missing. please check your installation of mysql and try again.
-----
*** extconf.rb failed ***
Could not create Makefile due to some reason, probably lack of
necessary libraries and/or headers. Check the mkmf.log file for more
details. You may need configuration options.
Provided configuration options:
--with-opt-dir
--without-opt-dir
--with-opt-include
--without-opt-include=${opt-dir}/include
--with-opt-lib
--without-opt-lib=${opt-dir}/lib
--with-make-prog
--without-make-prog
--srcdir=.
--curdir
--ruby=/usr/bin/ruby
--with-mysql-dir
--without-mysql-dir
--with-mysql-include
--without-mysql-include=${mysql-dir}/include
--with-mysql-lib
--without-mysql-lib=${mysql-dir}/lib
--with-mysql-config
--without-mysql-config
Gem files will remain installed in /usr/lib/ruby/gems/1.8/gems/mysql2-0.3.15 for inspection.
Results logged to /usr/lib/ruby/gems/1.8/gems/mysql2-0.3.15/ext/mysql2/gem_make.out
当我运行转速-qa | grep mysql我有以下几种
[root bin]# rpm -qa | grep mysql
mysql-server-5.1.73-3.el6_5.x86_64
mysql-libs-5.1.73-3.el6_5.x86_64
mysql-devel-5.1.73-3.el6_5.x86_64
mysql-5.1.73-3.el6_5.x86_64
大多数其他解决方案说安装mysql-devel,但我已经安装了。看我可以在/ usr/include/mysql中看到mysql.h。大多数其他人也在/ usr/bin/mysql_config中缺少mysql_config行。
有没有人有任何ides。谢谢!
编辑:添加更多的一些细节 Centos的6.5全新安装(木偶大师从木偶实验室回购,然后加入EPEL,然后theforeman安装,试图sqlite的迁移到MySQL数据库,但需要安装mysql2宝石) MySQL 5.1中
因此,在查看日志mkmf.log后,我发现一行启动了mysql.h旁边的gcc。我不知道我是否安装了gcc,所以我做了一个yum gcc并尝试了另一个gem install mysql2,它工作正常!希望这可以帮助别人 – blankstar85