2011-07-18 154 views
0

我已经检查了这个网站上关于这个错误的许多主题,但是没有找到任何有用的东西。我对此很陌生。我正在使用Windows Server 2003 R2。安装MySql2的问题gem

当我调用:

gem install mysql2 

我得到这个错误:

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

     C:/Ruby192/bin/ruby.exe extconf.rb 
checking for rb_thread_blocking_region()... yes 
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:/Ruby192/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-libmysqllib 
     --without-libmysqllib 


Gem files will remain installed in C:/Ruby192/lib/ruby/gems/1.9.1/gems/mysql2-0. 
3.6 for inspection. 
Results logged to C:/Ruby192/lib/ruby/gems/1.9.1/gems/mysql2-0.3.6/ext/mysql2/ge 
m_make.out 

回答

0

我有同样的问题。

在此之后link

我用命令gem install mysql2 -- '--with-mysql-lib="c:\Program Files\MySQL\MySQL Server 5.5\lib" --with-mysql-include="c:\Program Files\MySQL\MySQL Server 5.5\include"'

,并为我工作。