gpt4 book ai didi

mysql - 在 Windows 7 机器上的 ROR 中安装 Mysql Gem

转载 作者:行者123 更新时间:2023-11-29 13:23:04 26 4
gpt4 key购买 nike

我尝试安装 mysql2 gem,但看到此错误。

Using --with-mysql-dir=C:/mysql-connector
-----
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-x64/bin/ruby
--with-mysql-dir
--with-mysql-include
--without-mysql-include=${mysql-dir}/include
--with-mysql-lib
--without-mysql-lib=${mysql-dir}/
--with-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:/Ruby200-x64/lib/ruby/gems/2.0.0/gems/mysql2-0.3.14 for inspec
Results logged to C:/Ruby200-x64/lib/ruby/gems/2.0.0/gems/mysql2-0.3.14/ext/mysql2/gem_make.out

我尝试将 llibmysql.dll 文件复制到 Ruby/binRuby/lib 文件夹,但没有看到成功。

如果有人遇到过这个问题,请告诉我(我猜这是 Windows 7 + ROR + Mysql 特有的)

最佳答案

这对我有用:

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


Temporarily enhancing PATH to include DevKit...
Building native extensions. This could take a while...
Successfully installed mysql2-0.3.14
1 gem installed
Installing ri documentation for mysql2-0.3.14...
DL is deprecated, please use Fiddle
Installing RDoc documentation for mysql2-0.3.14...

关于mysql - 在 Windows 7 机器上的 ROR 中安装 Mysql Gem,我们在Stack Overflow上找到一个类似的问题: https://stackoverflow.com/questions/20525724/

26 4 0
Copyright 2021 - 2024 cfsdn All Rights Reserved 蜀ICP备2022000587号
广告合作:1813099741@qq.com 6ren.com