得到错误的mysql。当bundle安装ROR时,h丢失了。

时间:2023-01-04 00:18:05

I am using Centos 5.8, mysql5.5, ruby 1.9.1, rails 3.0.9 and mysql2 -v 0.2.7 gem.

我使用Centos 5.8、mysql5.5、ruby 1.9.1、rails 3.0.9和mysql2 - v0.2.7 gem。

While doing 'bundle install', I get this error:

在进行“捆绑安装”时,我得到了这个错误:

Installing mysql2 (0.2.7) with native extensions 
Gem::Installer::ExtensionBuildError: ERROR: Failed to build gem native extension.

/usr/local/bin/ruby extconf.rb 
checking for rb_thread_blocking_region()... yes
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/local/bin/ruby
    --with-mysql-config
    --without-mysql-config


Gem files will remain installed in /usr/local/lib/ruby/gems/1.9.1/gems/mysql2-0.2.7 for inspection.
Results logged to /usr/local/lib/ruby/gems/1.9.1/gems/mysql2-0.2.7/ext/mysql2/gem_make.out
An error occured while installing mysql2 (0.2.7), and Bundler cannot continue.
Make sure that `gem install mysql2 -v '0.2.7'` succeeds before bundling.

I explored various solutions.eg. I tried this:

我探索各种solutions.eg。我试着这样的:

sudo yum install mysql-devel

and got this error:

并得到这个错误:

Loaded plugins: dellsysid, fastestmirror
Loading mirror speeds from cached hostfile
 * base: mirror.hmc.edu
 * epel: linux.mirrors.es.net
 * extras: centos.mirrors.hoobly.com
 * updates: centos.sonn.com
Setting up Install Process
Resolving Dependencies
--> Running transaction check
---> Package mysql-devel.i386 0:5.0.95-1.el5_7.1 set to be updated
---> Package mysql-devel.x86_64 0:5.0.95-1.el5_7.1 set to be updated
--> Processing Dependency: libmysqlclient_r.so.15()(64bit) for package: mysql-devel
--> Processing Dependency: libmysqlclient.so.15()(64bit) for package: mysql-devel
--> Finished Dependency Resolution
mysql-devel-5.0.95-1.el5_7.1.x86_64 from updates has depsolving problems
  --> Missing Dependency: libmysqlclient.so.15()(64bit) is needed by package mysql-devel-5.0.95-1.el5_7.1.x86_64 (updates)
mysql-devel-5.0.95-1.el5_7.1.x86_64 from updates has depsolving problems
  --> Missing Dependency: libmysqlclient_r.so.15()(64bit) is needed by package mysql-devel-5.0.95-1.el5_7.1.x86_64 (updates)
Error: Missing Dependency: libmysqlclient.so.15()(64bit) is needed by package mysql-devel-5.0.95-1.el5_7.1.x86_64 (updates)
Error: Missing Dependency: libmysqlclient_r.so.15()(64bit) is needed by package mysql-devel-5.0.95-1.el5_7.1.x86_64 (updates)

Installing libmysqlclient-dev libmysqlclient16 was also not working on centos as there is no such package

安装libmysqlclient-dev libmysqlclient16也没有使用centos,因为没有这样的包。

Please suggest solution.

请建议解决方案。

Thanks.

谢谢。

2 个解决方案

#1


2  

This problem got solved by installing mysql-devel 5.5. Earlier mysql-devel 5.0 was installed for mysql5.5.

这个问题通过安装mysql-devel 5.5得到了解决。之前已经为mysql5.5安装了mysql-devel 5.0。

#2


-1  

first of all download server for your mysql database. and copy the file" libmysql.dll" wich is in mysql //bin and paste it in " Ruby\bin" and restart the server..

首先为mysql数据库下载服务器。复制文件“libmysql”。dll“在mysql //bin中,并将其粘贴到“Ruby\bin”中并重新启动服务器。

#1


2  

This problem got solved by installing mysql-devel 5.5. Earlier mysql-devel 5.0 was installed for mysql5.5.

这个问题通过安装mysql-devel 5.5得到了解决。之前已经为mysql5.5安装了mysql-devel 5.0。

#2


-1  

first of all download server for your mysql database. and copy the file" libmysql.dll" wich is in mysql //bin and paste it in " Ruby\bin" and restart the server..

首先为mysql数据库下载服务器。复制文件“libmysql”。dll“在mysql //bin中,并将其粘贴到“Ruby\bin”中并重新启动服务器。