我正在为Ruby on Rails 3.0.5应用程序Mac OS X 10.6解决MySQL问题.
我安装了MySQL 5.1版,但出现此错误:
dyld: lazy symbol binding failed: Symbol not found: _mysql_init
Referenced from: /Users/manny/.gem/ruby/1.8/gems/mysql2-0.2.6/lib/mysql2/mysql2.bundle
Expected in: flat namespace
dyld: Symbol not found: _mysql_init
Referenced from: /Users/manny/.gem/ruby/1.8/gems/mysql2-0.2.6/lib/mysql2/mysql2.bundle
Expected in: flat namespace
Trace/BPT trap
我尝试安装MySQL v5.5,但仍然出现错误.我从.dmg安装了MySQL.
解决方法:
您不需要删除MySQL并重新安装它,我只需使用以下命令即可.在终端上执行此操作非常简单,它将解决您的问题:
rvmsudo ARCHFLAGS="-arch x86_64" gem install mysql2 -- --with-mysql-config=/usr/local/mysql/bin/mysql_config --with-opt-lib=/usr/local/mysql/lib
我希望这可以帮助您解决问题.