gpt4 book ai didi

mysql - 用windows安装mysql2出错

转载 作者:数据小太阳 更新时间:2023-10-29 08:17:46 25 4
gpt4 key购买 nike

奇怪的是我可以用这个命令安装 mysql2:$ gem install mysql2 --platform=ruby -- '--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.10
1 gem installed
Installing ri documentation for mysql2-0.3.10...
Installing RDoc documentation for mysql2-0.3.10...

但是当我运行bundle install时(显然我有很多gem需要安装),安装mysql2失败,所以bundle install停在那里,这真的让我发疯......任何人都可以帮忙吗?非常感谢!以下是 bundle install 的结果:

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

c:/Ruby192/bin/ruby.exe extconf.rb
checking for rb_thread_blocking_region()... yes
checking for rb_wait_for_single_fd()... no
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 G:/Desktop/20090319-/Rails Examples/ClockingI
T/vendor/bundle/ruby/1.9.1/gems/mysql2-0.3.8 for inspection.
Results logged to G:/Desktop/20090319-/Rails Examples/ClockingIT/vendor/bundle/r
uby/1.9.1/gems/mysql2-0.3.8/ext/mysql2/gem_make.out
An error occured while installing mysql2 (0.3.8), and Bundler cannot continue.
Make sure that `gem install mysql2 -v '0.3.8'` succeeds before bundling.

最佳答案

在我的 ubuntu 机器上,必须先运行 apt-get install libmysqld-dev,然后运行 ​​gem install mysql2 ... 效果非常好:)

关于mysql - 用windows安装mysql2出错,我们在Stack Overflow上找到一个类似的问题: https://stackoverflow.com/questions/8242565/

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