rails 3 mysql2 gem not working when trying to change database from sqlite to mysql

2k Views Asked by At

I have update the database.yml to:

development:
    adapter: mysql2
    encoding: utf8
    reconnect: false
    database: dreamcity
    pool: 5
    username: root
    password: root
    host: localhost
    socket: /var/mysql/mysql.sock

I can open mysql by key in: rails dbconsole now. But when I try rake db:schema:load or rake db:reset, rails complains:

dyld: lazy symbol binding failed: Symbol not found: _mysql_init
  Referenced from: /Library/Ruby/Gems/1.8/gems/mysql2-0.2.6/lib/mysql2/mysql2.bundle
  Expected in: flat namespace

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

What's the problem? I have included mysql2 in Gemfile and perform bundle install. Everything else is fine...

0

There are 0 best solutions below