无法让 mysql gem 在 Snow Leopard 中工作,无法在 Rails 环境中设置 ruby
我遇到了一些严重的问题,但这似乎是很常见的事情。我有 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 技术交流群。
绑定邮箱获取回复消息
由于您还没有绑定你的真实邮箱,如果其他用户或者作者回复了您的评论,将不能在第一时间通知您!
发布评论
评论(2)
这些说明在 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
如果您已从 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.