简体   繁体   English

OSX dyld:懒惰的符号绑定失败:找不到符号:_mysql_get_client_info

[英]OSX dyld: lazy symbol binding failed: Symbol not found: _mysql_get_client_info

I installed mysql (5.6.27), the newest mysql version at this time(5.7..). 我安装了mysql(5.6.27),这是当前最新的mysql版本(5.7 ..)。

I have mysql2 gem installed with version - 0.3.14 我安装了mysql2 gem-版本0.3.14

When i try to run rake db:create i get error message: 当我尝试运行rake db:create出现错误消息:

Karliss-Air:gostyling myuser$ rake db:create
dyld: lazy symbol binding failed: Symbol not found: _mysql_get_client_info
  Referenced from: /Users/myuser/.rvm/gems/ruby-2.1.2/extensions/x86_64-darwin-13/2.1.0-static/mysql2-0.3.14/mysql2/mysql2.bundle
  Expected in: flat namespace

dyld: Symbol not found: _mysql_get_client_info
  Referenced from: /Users/myuser/.rvm/gems/ruby-2.1.2/extensions/x86_64-darwin-13/2.1.0-static/mysql2-0.3.14/mysql2/mysql2.bundle
  Expected in: flat namespace

BUT the wierd thing is when i run nm -gU it shows that the dylib is there: 但是更奇怪的是,当我运行nm -gU它表明dylib在其中:

Karliss-Air:gostyling myuser$ nm -gU /usr/local/lib/libmysqlclient.18.dylib | grep _mysql_get_client_info
0000000000002ff5 T _mysql_get_client_info
Karliss-Air:gostyling myuser$ 

I have tryed to define mysql path when instsalling the gem 安装gem时,我尝试定义mysql路径

gem pristine mysql2 -v '0.3.14' -- --with-mysql-dir=/usr/local/Cellar/mysql56/5.6.27 -–with-mysql-config=/usr/local/Cellar/mysql56/5.6.27/bin/mysql_config

It doesnt help. 它没有帮助。

I would really appriciate the help! 我真的很乐意提供帮助!

If you are using rvm/without rvm(just use sudo) then please use the following command which solve the issues. 如果您使用的是rvm /不带rvm(只需使用sudo),则请使用以下命令解决问题。

rvmsudo ARCHFLAGS="-arch x86_64" gem install mysql2 -- --with-mysql-config=/usr/local/mysql/bin/mysql_config --with-opt-lib=/usr/local/mysql/lib 

else try,uninstalling mysql2 gem and then installing gem with sudo would solve it sometimes. 否则,尝试卸载mysql2 gem,然后使用sudo安装gem有时会解决。

sudo gem uninstall mysql2

sudo gem install mysql2

or look into this: Lazy symbol binding failed when creating ruby db 或者看一下: 创建Ruby数据库时,懒惰符号绑定失败

Resolved the issue by reinstalling my macbook. 通过重新安装Macbook解决了该问题。 The problem, i think, was that i installed mysql5.7 first, then tryed to use mysql56. 我认为问题是我先安装了mysql5.7,然后尝试使用mysql56。 After reinstall i installed mysql56 straight away and everything worked just fine. 重新安装后,我立即安装了mysql56,一切正常。

暂无
暂无

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

相关问题 Ruby on Rails服务器无法启动:dyld:惰性符号绑定失败:未找到符号:_mysql_get_client_info - Ruby on Rails server won't start: dyld: lazy symbol binding failed: Symbol not found: _mysql_get_client_info 在C中出现错误消息“未定义的符号:mysql_get_client_info” - Error message “undefined symbol: mysql_get_client_info” in C 从node.js应用程序连接到mysql,错误:“ dyld:惰性符号绑定失败:找不到符号:_mysql_init” - Connect to mysql from node.js app, error: “dyld: lazy symbol binding failed: Symbol not found: _mysql_init” 未定义对“ mysql_get_client_info”的引用 - undefined reference to `mysql_get_client_info' RoR3和MySQL错误:dyld:找不到符号:_mysql_init - RoR3 and MySQL error: dyld: Symbol not found: _mysql_init Perl无法编译,找不到_mysql_init的懒惰符号绑定错误 - perl cannot compile with error of lazy symbol binding not found for _mysql_init 在OSX上使用MySQLdb的问题:找不到符号_mysql_affected_rows - Problem using MySQLdb on OSX: symbol not found _mysql_affected_rows macos 10.11 安装mysql 提示“dyld: Symbol not found: _SSL_library_ini” - macos 10.11 install mysql and prompt “dyld: Symbol not found: _SSL_library_ini” sql :: mysql :: get_driver_instance()找不到符号 - sql::mysql::get_driver_instance() Symbol not found mysql2 gem在OSX上加载Rails env时出错:“未找到符号:_rb_prohibit_interrupt” - Error with mysql2 gem loading Rails env on OSX: “Symbol not found: _rb_prohibit_interrupt”
 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM