dyld: Library not loaded

前两天升级过node,今天重启电脑后postgres无法开机启动。
手动启动出现错误提示:

dyld: Library not loaded: /usr/local/opt/icu4c/lib/libicui18n.63.dylib
  Referenced from: /usr/local/Cellar/postgresql/11.1_1/bin/postgres
  Reason: image not found
no data was returned by command ""/usr/local/Cellar/postgresql/11.1_1/bin/postgres" -V"
The program "postgres" is needed by pg_ctl but was not found in the
same directory as "/usr/local/Cellar/postgresql/11.1_1/bin/pg_ctl".
Check your installation.

经过检查发现/usr/local/opt/icu4c/lib链接的是64.2,而之前安装postgres依赖的是63.1的。所以,处理方法大致就清楚了。

这里有两种解决办法:

如果/usr/local/Cellar/icu4c下还有63.1的目录,通常升级过icu4c应该就没有了。将目录下的下列文件复制到/usr/local/opt/icu4c/lib/下。

libicudata.62.1.dylib
libicudata.62.dylib
libicui18n.62.dylib
libicuio.62.dylib
libicuuc.62.dylib

更新postgres到最新版本,适配新的icu4c版本即可。

brew cleanup
brew upgrade postgres

搞定。

如需转载,请注明出处: https://www.chadou.me/p/238

你都看到这儿了,
领个红包再走吧。

最新发布