2013-06-03 61 views
1

我一直在寻找这个错误,重新安装了所有东西,并尝试了everthing。我在这里找到的所有内容都是旧帖子和旧版本。 是的,我已经下载了MySQL C Connector并将lib移动到该ruby目录。依然没有。无法安装gem install mysql2红宝石WINx64

进出口运行在PC WINx64 红宝石版本2.0.0-P195的devkit

**gem install mysql2** 
**Temporarily enhancing PATH to include DevKit... 
Building native extensions. This could take a while... 
ERROR: Error installing mysql: 
     ERROR: Failed to build gem native extension. 

    C:/Ruby200/bin/ruby.exe extconf.rb 
checking for main() in -llibmysql... no 
*** 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=C:/Ruby200/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}/ 
     --with-libmysqllib 
     --without-libmysqllib 


Gem files will remain installed in C:/Ruby200/lib/ruby/gems/2.0.0/gems/mysql-2.9.1 for inspection. 
Results logged to C:/Ruby200/lib/ruby/gems/2.0.0/gems/mysql-2.9.1/ext/mysql_api/gem_make.out** 

B:\ROR\hcv> 

Windows正在给我的问题所有的时间 最新版本。但这是我在工作中的一切。感谢你们。

回答

1

我已经从http://dev.mysql.com/downloads/mirror.php?id=412857

下载的连接器,并在命令提示

宝石安装mysql --platform =红宝石类型 - --with MySQL的-包括= C:\ mysql-连接器-C-6.1.0-winx64 \包括--with MySQL的-LIB = C:\ MySQL的连接器-C-6.1.0-winx64 \ lib中

0

尝试使用以下命令
安装MySQL宝石

gem install mysql2 -- '--with-mysql-lib="c:\Program Files\MySQL\MySQL Server 5.0\lib\opt" --with-mysql-include="c:\Program Files\MySQL\MySQL Server 5.0\include"' 

注意:根据您的安装更改mysql安装目录