Rails没有连接到MySQL

时间:2012-05-20 22:30:30

标签: mysql ruby-on-rails

我正在尝试让我的数据库与我的SQL数据库正确连接和交互。当我输入...

rake db:schema:dump

我得到........

simple_cms gregpfeffer$ rake db:schema:dump
dyld: lazy symbol binding failed: Symbol not found: _mysql_get_client_info
  Referenced from: /Library/Ruby/Gems/1.8/gems/mysql2-0.3.11/lib/mysql2/mysql2.bundle
  Expected in: flat namespace

dyld: Symbol not found: _mysql_get_client_info
  Referenced from: /Library/Ruby/Gems/1.8/gems/mysql2-0.3.11/lib/mysql2/mysql2.bundle
  Expected in: flat namespace

Trace/BPT trap: 5

我编辑了我的database.yml现在读...

#   http://dev.mysql.com/doc/refman/5.0/en/old-client.html
development:
  adapter: mysql
  encoding: utf8
  reconnect: false
  database: simple_cms_development
  pool: 5
  username: simple_cms      
  password: XXXXXXXXXX
  socket: /tmp/mysql.sock

有什么想法在这里发生?我安装了mySQL和mySQL2 gem,不确定是否有帮助。

非常感谢! Greg Pfeffer

1 个答案:

答案 0 :(得分:1)

尝试使用mysql2作为适配器。看来你正在使用mysql2 gem。

  adapter: mysql2