简体   繁体   English

无法安装gem install mysql2 Ruby WINx64

[英]Can't Install gem install mysql2 Ruby WINx64

I've been searching for this error, reinstaled everything, and tried everthing. 我一直在寻找这个错误,重新安装了一切,然后尝试了一切。 All I found here are old posts, and old versions. 我在这里找到的只是旧帖子和旧版本。 Yes, I've downloaded MySQL C Connector and move the lib to that ruby dir. 是的,我已经下载了MySQL C Connector并将库移至该ruby目录。 Still nothing. 依然没有。

Im running a PC WINx64 Ruby version 2.0.0-p195 Lastest Version of DevKit 我正在运行PC WINx64 Ruby 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 is giving me problems all time. Windows一直给我麻烦。 But this is all I have at Work. 但这就是我在工作中所拥有的全部。 Thank You guys. 感谢大伙们。

I've downloaded the connector from http://dev.mysql.com/downloads/mirror.php?id=412857 我已经从http://dev.mysql.com/downloads/mirror.php?id=412857下载了连接器

and typed in the command prompt 并在命令提示符下键入

gem install mysql --platform=ruby -- --with-mysql-include=C:\\mysql-connector-c-6.1.0-winx64\\include --with-mysql-lib=C:\\mysql-connector-c-6.1.0-winx64\\lib gem install mysql --platform = ruby​​---with-mysql-include = C:\\ mysql-connector-c-6.1.0-winx64 \\ include --with-mysql-lib = C:\\ mysql-connector-c -6.1.0-winx64 \\ LIB

Try to install the mysql gem using following command 尝试使用以下命令安装mysql gem

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"'

note: Change the mysql installation directory as per your installation 注意:根据您的安装更改mysql安装目录

声明:本站的技术帖子网页,遵循CC BY-SA 4.0协议,如果您需要转载,请注明本站网址或者原文地址。任何问题请咨询:yoyou2525@163.com.

 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM