简体   繁体   English

Ruby on Rails mysql2 gem故障排除

[英]Ruby on Rails mysql2 gem troubleshot

I have created new ruby on rails project with mysql database. 我已经用mysql数据库在rails项目上创建了新的ruby。 I have run mysql server by running mysql.server start When I try to run rake db:create, I got following error: 我已经通过运行mysql.server start运行了mysql服务器。当我尝试运行rake db:create时,出现以下错误:

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

Anybody can solve this issue? 谁能解决这个问题? Please reachout me. 请联系我。 Regards. 问候。

The salient details are that you need to update the DYLD_LIBRARY_PATH to include /usr/local/mysql/lib . 重要的细节是您需要更新DYLD_LIBRARY_PATH以包括/ usr / local / mysql / lib The easiest way of doing that is to add the following to your ~/.bashrc file: 最简单的方法是将以下内容添加到〜/ .bashrc文件中:

export DYLD_LIBRARY_PATH="/usr/local/mysql/lib:$DYLD_LIBRARY_PATH"

I went into a little more detail in a blog post here: http://www.bartbusschots.ie/blog/?p=2186 我在这里的博客文章中介绍了更多细节: http : //www.bartbusschots.ie/blog/?p=2186

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

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