gpt4 book ai didi

mysql - 安装 Mysql2 gem- 10.6 服务器时出错

转载 作者:可可西里 更新时间:2023-11-01 07:10:44 25 4
gpt4 key购买 nike

我正在尝试在 10.6 服务器上安装 mysql2 gem,但我收到一条我从未见过的错误消息:

EBuilding native extensions.  This could take a while...
ERROR: Error installing mysql2:
ERROR: Failed to build gem native extension.

/System/Library/Frameworks/Ruby.framework/Versions/1.8/usr/bin/ruby extconf.rb
checking for rb_thread_blocking_region()... no
checking for mysql.h... no
checking for mysql/mysql.h... no
-----
mysql.h is missing. please check your installation of mysql and try again.
-----
*** 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=/System/Library/Frameworks/Ruby.framework/Versions/1.8/usr/bin/ruby
--with-mysql-config
--without-mysql-config


Gem files will remain installed in /Library/Ruby/Gems/1.8/gems/mysql2-0.2.6 for inspection.
Results logged to /Library/Ruby/Gems/1.8/gems/mysql2-0.2.6/ext/mysql2/gem_make.out

我已经尝试了一些东西,指定了内置 MySQL 的存储位置 sudo gem install mysql2 -- --with-mysql-dir=/var/mysql 并替换了内置的- 在 mysql 中使用来自 mysql.com 的预构建 64 位安装程序

有什么想法吗?

最佳答案

想通了:

sudo env ARCHFLAGS="-arch x86_64" gem install mysql2 -- --with-mysql-config=/usr/local/mysql/bin/mysql_config

关于mysql - 安装 Mysql2 gem- 10.6 服务器时出错,我们在Stack Overflow上找到一个类似的问题: https://stackoverflow.com/questions/4424581/

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