gpt4 book ai didi

mysql - OSX dyld : lazy symbol binding failed: Symbol not found: _mysql_get_client_info

转载 作者:行者123 更新时间:2023-11-29 11:46:49 25 4
gpt4 key购买 nike

我安装了mysql(5.6.27),此时最新的mysql版本(5.7..)。

我安装了 mysql2 gem,版本为 0.3.14

当我尝试运行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

但奇怪的是,当我运行 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$

我尝试在安装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

这没有帮助。

我真的很感谢您的帮助!

最佳答案

如果您使用 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 

或者尝试一下,卸载mysql2 gem,然后用sudo安装gem有时会解决这个问题。

sudo gem uninstall mysql2

sudo gem install mysql2

或者看看这个:Lazy symbol binding failed when creating ruby db

关于mysql - OSX dyld : lazy symbol binding failed: Symbol not found: _mysql_get_client_info,我们在Stack Overflow上找到一个类似的问题: https://stackoverflow.com/questions/34788330/

25 4 0
Copyright 2021 - 2024 cfsdn All Rights Reserved 蜀ICP备2022000587号
广告合作:1813099741@qq.com 6ren.com