gpt4 book ai didi

mysql - El Capitan 升级 : Library not loaded:/usr/local/lib/libmysqlclient. 18.dylib

转载 作者:IT老高 更新时间:2023-10-28 23:41:49 26 4
gpt4 key购买 nike

错误:

/Users/askar/.rbenv/versions/2.2.3/lib/ruby/gems/2.2.0/gems/mysql2-0.3.20/lib/mysql2.rb:31:in `require': dlopen(/Users/askar/.rbenv/versions/2.2.3/lib/ruby/gems/2.2.0/extensions/x86_64-darwin-14/2.2.0-static/mysql2-0.3.20/mysql2/mysql2.bundle, 9): Library not loaded: /usr/local/lib/libmysqlclient.18.dylib (LoadError)
Referenced from: /Users/askar/.rbenv/versions/2.2.3/lib/ruby/gems/2.2.0/extensions/x86_64-darwin-14/2.2.0-static/mysql2-0.3.20/mysql2/mysql2.bundle
Reason: image not found - /Users/askar/.rbenv/versions/2.2.3/lib/ruby/gems/2.2.0/extensions/x86_64-darwin-14/2.2.0-static/mysql2-0.3.20/mysql2/mysql2.bundle

在 Gemfile 中:gem 'mysql2'

$ ls -al/usr/local/lib/libmysql*

lrwxr-xr-x  1 askar  admin  49 Nov 13 10:48 /usr/local/lib/libmysqlclient.20.dylib -> ../Cellar/mysql/5.7.9/lib/libmysqlclient.20.dylib
lrwxr-xr-x 1 askar admin 42 Nov 13 10:48 /usr/local/lib/libmysqlclient.a -> ../Cellar/mysql/5.7.9/lib/libmysqlclient.a
lrwxr-xr-x 1 askar admin 46 Nov 13 10:48 /usr/local/lib/libmysqlclient.dylib -> ../Cellar/mysql/5.7.9/lib/libmysqlclient.dylib
lrwxr-xr-x 1 askar admin 37 Nov 13 10:48 /usr/local/lib/libmysqld.a -> ../Cellar/mysql/5.7.9/lib/libmysqld.a
lrwxr-xr-x 1 askar admin 44 Nov 13 10:48 /usr/local/lib/libmysqlservices.a -> ../Cellar/mysql/5.7.9/lib/libmysqlservices.a

$ ls -al/usr/local/Cellar/mysql/5.7.9/lib/

total 84392
drwxr-xr-x 9 askar admin 306 Nov 12 22:16 .
drwxr-xr-x 14 askar admin 476 Nov 13 10:48 ..
-r--r--r-- 1 askar admin 3780168 Nov 13 10:48 libmysqlclient.20.dylib
-r--r--r-- 1 askar admin 4280752 Nov 12 22:16 libmysqlclient.a
lrwxr-xr-x 1 askar admin 23 Nov 12 22:16 libmysqlclient.dylib -> libmysqlclient.20.dylib
-r--r--r-- 1 askar admin 35126528 Nov 12 22:16 libmysqld.a
-r--r--r-- 1 askar admin 9048 Nov 12 22:16 libmysqlservices.a
drwxr-xr-x 3 askar admin 102 Nov 13 10:48 pkgconfig
drwxr-xr-x 43 askar admin 1462 Nov 12 22:17 plugin
drwxr-xr-x 43 askar admin 1462 Nov 12 22:17 plugin

如您所见,我有 libmysqlclient.20.dylib,它是 20 而不是 18,否则我会遵循解决方案 here .

我最近升级到 El Capitan,但不确定是不是这个原因。

更新:

感谢@Rashmirathi 提供重新安装 gem 的提示。

只是想说明,我还需要在 Gemfile 中指定为:

gem 'mysql2', '~> 0.3.18'

否则我有错误:

Specified 'mysql2' for database adapter, but the gem is not loaded. Add gem 'mysql2' to your Gemfile (and ensure its version is at the minimum required by ActiveRecord).

但最后我得到了错误:

Mysql2::Error
Your password has expired. To log in you must change it using a client that supports expired passwords.

再次设置密码即可解决:

SET PASSWORD=PASSWORD('your_password');

最佳答案

我之前遇到了同样的问题,我通过重新安装 gem mysql2 来解决它。

关于mysql - El Capitan 升级 : Library not loaded:/usr/local/lib/libmysqlclient. 18.dylib,我们在Stack Overflow上找到一个类似的问题: https://stackoverflow.com/questions/33772047/

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