无法让 mysql gem 在 Snow Leopard 中工作,无法在 Rails 环境中设置 ruby

发布于 2024-08-29 23:32:35 字数 759 浏览 4 评论 0原文

我遇到了一些严重的问题,但这似乎是很常见的事情。我有 Snow Leopard 10.6.3,这是我的其他版本信息: MySQL mysql Ver 14.14 Distrib 5.1.46,适用于 apple-darwin10.2.0 (i386),使用 readline 5.1 宝石1.3.6 ruby 1.8.7 (2009-06-08 patchlevel 173) [universal-darwin10.0]

我的问题是,无论我做什么来尝试安装 mysql gem,每次我执行 rake db:migrate 时仍然会收到错误

未初始化常量 MysqlCompat::MysqlRes

我已经根据网上说要使用的说明安装了 mysql gem

导出 ARCHFLAGS="-arch i386 -arch x86_64" ; sudo gem install --no-rdoc --no-ri mysql ---v 2.7 --with-mysql-dir=/usr/local --with-mysql-config=/usr/local/mysql/bin/mysql_config < /p>

这个确实有效,因为它给出了以下输出:

构建本机扩展。这可能需要一段时间... 成功安装mysql-2.8.1 安装 1 个 gem

任何帮助将不胜感激

I am having some serious problems, however this seems to be a common thing. I have Snow Leopard 10.6.3 and here are my other version info:
MySQL
mysql Ver 14.14 Distrib 5.1.46, for apple-darwin10.2.0 (i386) using readline 5.1
gem 1.3.6
ruby 1.8.7 (2009-06-08 patchlevel 173) [universal-darwin10.0]

My problem is that no matter what I do to try and install the mysql gem, i still get the error every time i do rake db:migrate

uninitialized constant MysqlCompat::MysqlRes

I have installed the mysql gem based on instructions around the web that say to use

export ARCHFLAGS="-arch i386 -arch x86_64" ; sudo gem install --no-rdoc --no-ri mysql -- -v 2.7 --with-mysql-dir=/usr/local --with-mysql-config=/usr/local/mysql/bin/mysql_config

This DOES work, as it gives this output:

Building native extensions. This could take a while...
Successfully installed mysql-2.8.1
1 gem installed

Any help would be greatly appreciated

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

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

发布评论

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

评论(2

祁梦 2024-09-05 23:32:35

这些说明在 Mac OS X Snow Leopard 上非常适合我: http://hivelogic .com/articles/compiling-mysql-on-snow-leopard

These instructions worked great for me on Mac OS X Snow Leopard: http://hivelogic.com/articles/compiling-mysql-on-snow-leopard

北方。的韩爷 2024-09-05 23:32:35

如果您已从 Leopard 迁移到 Snow Leopard,则可能需要重建 ruby​​。我遇到了同样的问题,我通过从源代码重新编译 ruby​​ 解决了这个问题。

另外,mysql gem 2.8(曾经?)与雪豹不兼容,所以你可以尝试2.7。 SO 上某处有对 2.8 问题的解释。

if you've migrated to snow leopard from leopard, you may need to rebuild ruby. I was having the same problem that I solved by recompiling ruby from source.

Also, mysql gem 2.8 is (was?) incompatible with snow leopard, so you may try 2.7. There was an explanation of 2.8 issues somewhere on SO.

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