即使安装了 mysql-devel、ruby-devel 和 ruby​​gems 后也无法运行安装 MySQL gem Fedora 14

发布于 2024-10-21 03:57:12 字数 923 浏览 5 评论 0原文

我正在尝试通过安装 mysql gem

sudo gem install mysql --version 2.7

但是,我收到以下错误:

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

/usr/bin/ruby extconf.rb
checking for mysql_query() in -lmysqlclient... no
checking for main() in -lm... yes
checking for mysql_query() in -lmysqlclient... no
checking for main() in -lz... yes
checking for mysql_query() in -lmysqlclient... no
checking for main() in -lsocket... no
checking for mysql_query() in -lmysqlclient... no
checking for main() in -lnsl... yes
checking for mysql_query() in -lmysqlclient... 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.

有什么想法吗?

I'm trying to install the mysql gem via

sudo gem install mysql --version 2.7

However, I get the following error:

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

/usr/bin/ruby extconf.rb
checking for mysql_query() in -lmysqlclient... no
checking for main() in -lm... yes
checking for mysql_query() in -lmysqlclient... no
checking for main() in -lz... yes
checking for mysql_query() in -lmysqlclient... no
checking for main() in -lsocket... no
checking for mysql_query() in -lmysqlclient... no
checking for main() in -lnsl... yes
checking for mysql_query() in -lmysqlclient... 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.

Any ideas?

如果你对这篇内容有疑问,欢迎到本站社区发帖提问 参与讨论,获取更多帮助,或者扫码二维码加入 Web 技术交流群。

扫码二维码加入Web技术交流群

发布评论

需要 登录 才能够评论, 你可以免费 注册 一个本站的账号。

评论(1

缺⑴份安定 2024-10-28 03:57:12

可以尝试的东西:

gem install mysql -- --with-mysql-config=/usr/local/mysql/bin/mysql_config

当然使用 mysql_config 所在的路径。如果您安装了 mysql 客户端,则 mysql_config 将会在那里,

gem install mysql -- \
--with-mysql-include=/usr/include/mysql \
--with-mysql-lib=/usr/lib/mysql

使用 mysql 的 lib 和标头所在的路径。

somethings to try:

gem install mysql -- --with-mysql-config=/usr/local/mysql/bin/mysql_config

of course use path of where your mysql_config is. mysql_config will be there if you've installed a mysql client

gem install mysql -- \
--with-mysql-include=/usr/include/mysql \
--with-mysql-lib=/usr/lib/mysql

use paths of where your lib and headers are for mysql.

~没有更多了~
我们使用 Cookies 和其他技术来定制您的体验包括您的登录状态等。通过阅读我们的 隐私政策 了解更多相关信息。 单击 接受 或继续使用网站,即表示您同意使用 Cookies 和您的相关数据。
原文