MySQL gem 问题 - 未定义的方法 `init'对于Mysql:类

发布于 2024-10-10 07:16:46 字数 502 浏览 0 评论 0原文

可能的重复:
'Mysql:Class 的未定义方法初始化'

这是我持续存在的问题的一部分升级到雪豹后就有了。

我重新安装了 MySQL、Ruby 和 Rails。现在,当我运行 Rails 服务器并转到 localhost:3000 时,我得到:

undefined method `init' for Mysql:Class

我正在运行
红宝石1.8.7
Rails 3.0.3
MySQL 5.5.8

我的 GemFile 中有 gem 'mysql'。

我无法弄清楚问题所在。有人可以帮忙吗?

Possible Duplicate:
'undefined method init for Mysql:Class'

This is part of an ongoing problem I've had after upgrading to Snow Leopard.

I've reinstalled MySQL, Ruby and Rails. Now when I run rails server and go to localhost:3000 I get:

undefined method `init' for Mysql:Class

I'm running
Ruby 1.8.7
Rails 3.0.3
MySQL 5.5.8

I have gem 'mysql' in my GemFile.

I can't figure out the problem. Can somebody help?

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

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

发布评论

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

评论(1

在你怀里撒娇 2024-10-17 07:16:46

您必须删除并使用新的 ruby​​ 本机扩展绑定重新安装 mysql gem。

使用 sudo 尝试此命令。

ARCHFLAGS="-arch i386" gem install mysql -- --with-mysql config=/usr/local/mysql/bin/mysql_config

You have to remove and then reinstall the mysql gem with the new ruby native extensions bindings.

Try this command with a sudo.

ARCHFLAGS="-arch i386" gem install mysql -- --with-mysql config=/usr/local/mysql/bin/mysql_config
~没有更多了~
我们使用 Cookies 和其他技术来定制您的体验包括您的登录状态等。通过阅读我们的 隐私政策 了解更多相关信息。 单击 接受 或继续使用网站,即表示您同意使用 Cookies 和您的相关数据。
原文