简体   繁体   English

mysql gem for Snow Leopard

[英]mysql gem for snow leopard

I had trouble with the gem at first but got it to work when I installed the 64-bit MySQL and reinsatlled the gem with arch flags. 起初我在使用gem时遇到了麻烦,但是当我安装64位MySQL并用拱形标志重新安装了gem时,它就开始工作了。

So it work in rails. 因此它可以在导轨中工作。 The error I used to get was 我以前得到的错误是

uninitialized constant MysqlCompat::MysqlRes

but that is now gone :) 但是现在不见了:)

However in Xcode when I run a RubyCocoa project I still get the old error of 但是在Xcode中,当我运行RubyCocoa项目时,仍然会收到以下旧错误:

uninitialized constant MysqlCompat::MysqlRes

Does anyone know why this may be? 有谁知道为什么会这样吗?

Is it because the gdb is 64-bit? 是因为gdb是64位吗?

How can it work in Rails but not in RubyCocoa? 它如何在Rails中工作而在RubyCocoa中不工作?

A little debugging shows that it fails to load mysql_api.bundle 稍作调试表明它无法加载mysql_api.bundle

/Library/Ruby/Gems/1.8/gems/mysql-2.8.1/lib/mysql_api.bundle: 
dlopen(/Library/Ruby/Gems/1.8/gems/mysql-2.8.1/lib/mysql_api.bundle, 9): no suitable image found. 
Did find: (LoadError) /Library/Ruby/Gems/1.8/gems/mysql-2.8.1/lib/mysql_api.bundle: mach-o, but wrong architecture - 
/Library/Ruby/Gems/1.8/gems/mysql-2.8.1/lib/mysql_api.bundle from /Library/Ruby/Site/1.8/rubygems/custom_require.rb:31:in `require'

The problem might be that xcode uses another version of the ruby framework than you are using normally, I had that trouble and solved it somehow. 问题可能是xcode使用了比正常使用的其他版本的ruby框架,我遇到了麻烦并以某种方式解决了它。

The architecture mismatch might be some other thing though: 但是,体系结构不匹配可能是其他原因:

/System/Library/Frameworks/Ruby.framework /System/Library/Frameworks/Ruby.framework

I had the same problem and it had something to do with an older MySQL installation if I remember correctly. 我遇到了同样的问题,如果我没记错的话,那与旧版MySQL安装有关。 I installed the 32-bit version by accident, noticed the mistake and installed the 64-bit one. 我偶然安装了32位版本,发现了错误并安装了64位版本。

I got rid of the error by removing MySQL as described here: How do you uninstall MySQL from Mac OS X and reinstalling the latest version with arch flags. 通过按以下说明删除MySQL,我摆脱了错误: 如何从Mac OS X卸载MySQL并重新安装带有拱形标志的最新版本。

Did you try this? 你有尝试过吗?

声明:本站的技术帖子网页,遵循CC BY-SA 4.0协议,如果您需要转载,请注明本站网址或者原文地址。任何问题请咨询:yoyou2525@163.com.

 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM