Ruby EE ./installer 在 mysql gem 安装上失败

发布于 2024-08-03 22:39:30 字数 1217 浏览 4 评论 0原文

因此,安装 Ruby Enterprise Edition 进行得相当顺利(除了我所在的系统有一个非常奇怪的怪癖,我必须 apt-get install build-essentials 因为没有 GCC... ),但未能正确安装任何数据库 gem。我主要想使用MySQL。这是 mysql gem 安装期间 Ruby EE 的 ./installer 的输出:

Installing mysql...
/opt/ruby-enterprise-1.8.6-20090610/bin/ruby /opt/ruby-enterprise-1.8.6-20090610/bin/gem install -r --no-rdoc --no-ri --no-update-sources --backtrace mysql
Building native extensions.  This could take a while...
ERROR:  Error installing mysql:
        ERROR: Failed to build gem native extension.

/opt/ruby-enterprise-1.8.6-20090610/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
checking for main() in -lmygcc... no
checking for mysql_query() in -lmysqlclient... no
*** extconf.rb failed ***

显然我的服务器的 MySQL 安装没有附带源代码,所以我不能只是重新编译并希望它能工作...我尝试下载该版本并编译它,但我不知道从这里该做什么。有什么想法吗? MySQL 已经在这台服务器上运行了相当多的数据库,所以我也不想弄乱这里已经有的东西......

So, installing Ruby Enterprise Edition went fairly smoothly (except for a very odd quirk of the system I'm on, where I had to apt-get install build-essentials because there was no GCC...), but it failed to install any of the database gems properly. I mainly want to use MySQL. Here's the output of Ruby EE's ./installer during the mysql gem installation:

Installing mysql...
/opt/ruby-enterprise-1.8.6-20090610/bin/ruby /opt/ruby-enterprise-1.8.6-20090610/bin/gem install -r --no-rdoc --no-ri --no-update-sources --backtrace mysql
Building native extensions.  This could take a while...
ERROR:  Error installing mysql:
        ERROR: Failed to build gem native extension.

/opt/ruby-enterprise-1.8.6-20090610/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
checking for main() in -lmygcc... no
checking for mysql_query() in -lmysqlclient... no
*** extconf.rb failed ***

Apparently my server's MySQL installation didn't come with source, so I can't just recompile and hope it works... I tried to download the version and compile that, but I'm not sure what to do from here. Any ideas? MySQL is already running on this server with quite a few databases, so I'd also rather not mess with what's already here...

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

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

发布评论

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

评论(2

一直在等你来 2024-08-10 22:39:30

经过一番努力后,我开始浏览 aptitude 希望找到一个可以解决问题的包。我找到了 libmysqlclient-dev,安装了它,并重建了 gem...并且它起作用了。我觉得很愚蠢,呵呵,但这只是我第一次尝试将 Rails 应用程序部署到真正的网络服务器。

After a fair bit of struggle, I started browsing through aptitude hoping to find a package that might solve the problem. I found libmysqlclient-dev, installed it, and rebuilt the gem... and it worked. I feel pretty stupid, heh, but this is only my first time trying to deploy a Rails app to a real webserver.

浅沫记忆 2024-08-10 22:39:30

你的系统是64位的吗?问题是 gem 安装程序找不到 mysqlclient。

1) 使用locate 确保mysqlclient 和mysql_config 在您的系统上。您可能需要首先更新定位数据库。 --locate mysqlclient 应该会显示一些以 .so、.a 等结尾的库文件。

2) 尝试
/opt/ruby-enterprise/bin/ruby /opt/ruby-enterprise/bin/gem 安装 mysql -- --with-mysql-config='/usr/bin/mysql_config' --no-rdoc --no-ri

(更新上面的内容以使用 mysql_config 和 ruby​​-enterprise 的正确目录)

Larry

Is your system 64bit? The problem is that the gem installer can't find mysqlclient.

1) Use locate to make sure that mysqlclient and mysql_config are on your system. You may need to first update the locate db. -- locate mysqlclient should show you a number of library files ending in .so, .a, etc.

2) Try
/opt/ruby-enterprise/bin/ruby /opt/ruby-enterprise/bin/gem install mysql -- --with-mysql-config='/usr/bin/mysql_config' --no-rdoc --no-ri

(update the above to use right dir for mysql_config and ruby-enterprise)

Larry

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