简体   繁体   English

Ruby on Rails,MySQL和Snow Leopard

[英]Ruby on Rails, MySQL and Snow Leopard

I have working fine my installation of Ruby on Rails on my Snow Leopard. 我在Snow Leopard上安装Ruby on Rails的工作正常。 I've tried for several days install MySQL with Ruby on Rails, all I've got when I run: 我已经尝试使用Ruby on Rails安装MySQL数天了,我在运行时所拥有的一切:

rake db:create

is: 是:

(in /Users/naikon/RoR/test2)
dyld: lazy symbol binding failed: Symbol not found: _mysql_init
  Referenced from: /Library/Ruby/Gems/1.8/gems/mysql2-0.2.4/ext/mysql2/mysql2.bundle
  Expected in: flat namespace

dyld: Symbol not found: _mysql_init
  Referenced from: /Library/Ruby/Gems/1.8/gems/mysql2-0.2.4/ext/mysql2/mysql2.bundle
  Expected in: flat namespace

Trace/BPT trap

I've tried with MySQL 32 and 64 bits (and deleting all several times), install mysql gem in all the ways I've found on the internet, including 我已经尝试过使用MySQL 32位和64位(并多次删除),以我在互联网上发现的所有方式安装mysql gem,包括

sudo env ARCHFLAGS="-arch x86_64" gem install mysql -- --with-mysql-config=/usr/local/mysql/bin/mysql_config

I'm lost, frustrated and I really appreciate some help. 我迷路了,沮丧了,我真的很感谢你的帮助。

Thanks. 谢谢。

Well lets start off with the fact your building the incorrect gem. 好吧,让我们从构建错误宝石的事实开始。

From your error report it appears your using Rails 3, and this doesn't use the "mysql" gem at all. 从错误报告中可以看到您正在使用Rails 3,并且根本不使用“ mysql” gem。 It uses the mysql2 gem which offers a number of performance features. 它使用mysql2 gem提供了许多性能功能。

You can read more about the mysql2 gem at http://github.com/brianmario/mysql2 您可以在http://github.com/brianmario/mysql2上阅读有关mysql2 gem的更多信息。

I think you will be fine once you install the correct gem. 我认为,一旦您安装了正确的宝石,您就可以了。 =) =)

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

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