dyld: Library not loaded: /usr/l

2020-09-10  本文已影响0人  夙小叶
截屏2020-09-10 上午10.54.03.png

问题:

dyld: Library not loaded: /usr/local/opt/readline/lib/libreadline.8.dylib
  Referenced from: /usr/local/bin/gpg
  Reason: image not found
Abort trap: 6

解决:

不知什么原因 /usr/local/opt 内的readline 没有了
readline 重新指向 /usr/local/opt 目录

ln -s /usr/local/Cellar/readline/8.0.4/ /usr/local/opt/readline

详细步骤:

  1. 检查文件链接信息
$ otool -L /usr/local/bin/gpg
/usr/local/bin/gpg:
    /usr/lib/libz.1.dylib (compatibility version 1.0.0, current version 1.2.11)
    /usr/lib/libbz2.1.0.dylib (compatibility version 1.0.0, current version 1.0.5)
    /usr/local/opt/gettext/lib/libintl.8.dylib (compatibility version 11.0.0, current version 11.0.0)
    /System/Library/Frameworks/CoreFoundation.framework/Versions/A/CoreFoundation (compatibility version 150.0.0, current version 1675.129.0)
    /usr/lib/libsqlite3.dylib (compatibility version 9.0.0, current version 308.4.0)
    /usr/local/opt/libgcrypt/lib/libgcrypt.20.dylib (compatibility version 23.0.0, current version 23.6.0)
    /usr/local/opt/libgpg-error/lib/libgpg-error.0.dylib (compatibility version 31.0.0, current version 31.0.0)
    /usr/local/opt/readline/lib/libreadline.8.dylib (compatibility version 8.0.0, current version 8.0.0)
    /usr/local/opt/libassuan/lib/libassuan.0.dylib (compatibility version 9.0.0, current version 9.3.0)
    /usr/lib/libiconv.2.dylib (compatibility version 7.0.0, current version 7.0.0)
    /usr/lib/libSystem.B.dylib (compatibility version 1.0.0, current version 1281.100.1)
/usr/local/opt/readline/lib/libreadline.8.dylib (compatibility version 8.0.0, current version 8.0.0)
  1. 检查路径目录内是否存在这个库(这里没有返回结果,也就是不存在)
$ ll /usr/local/opt/ | grep -i "readline"
  1. Cellar 找找 libreadline.8.dylib 的真实位置
$ ls /usr/local/Cellar | grep -i "readline"
readline


$ /usr/local/Cellar/readline/8.0.4/lib

-r--r--r--  1 ruiliang  staff   44512  2 22  2020 libhistory.8.0.dylib
lrwxr-xr-x  1 ruiliang  staff      20 12 20  2018 libhistory.8.dylib -> libhistory.8.0.dylib
-r--r--r--  1 ruiliang  staff   46048 12 20  2018 libhistory.a
lrwxr-xr-x  1 ruiliang  staff      20 12 20  2018 libhistory.dylib -> libhistory.8.0.dylib
-rw-r--r--  1 ruiliang  staff  243368  2 22  2020 libreadline.8.0.dylib
lrwxr-xr-x  1 ruiliang  staff      21 12 20  2018 libreadline.8.dylib -> libreadline.8.0.dylib
-r--r--r--  1 ruiliang  staff  406896 12 20  2018 libreadline.a
lrwxr-xr-x  1 ruiliang  staff      21 12 20  2018 libreadline.dylib -> libreadline.8.0.dylib
drwxr-xr-x  3 ruiliang  staff      96  2 22  2020 pkgconfig
  1. 建立软连接
$ ln -s /usr/local/Cellar/readline/8.0.4/ /usr/local/opt/readline

REF:

上一篇下一篇

猜你喜欢

热点阅读