On macOS 13.2, in zsh
, ls
returns the following error message:
dyld[15164]: Library not loaded: /usr/local/opt/libgit2/lib/libgit2.1.6.dylib
Referenced from: <14346135-E664-31AF-A80B-05A5335ED5D7> /usr/local/Cellar/exa/0.10.1_1/bin/exa
Reason: tried: '/usr/local/opt/libgit2/lib/libgit2.1.6.dylib' (no such file), '/System/Volumes/Preboot/Cryptexes/OS/usr/local/opt/libgit2/lib/libgit2.1.6.dylib' (no such file), '/usr/local/opt/libgit2/lib/libgit2.1.6.dylib' (no such file), '/usr/local/lib/libgit2.1.6.dylib' (no such file), '/usr/lib/libgit2.1.6.dylib' (no such file, not in dyld cache), '/usr/local/Cellar/libgit2/1.7.2/lib/libgit2.1.6.dylib' (no such file), '/System/Volumes/Preboot/Cryptexes/OS/usr/local/Cellar/libgit2/1.7.2/lib/libgit2.1.6.dylib' (no such file), '/usr/local/Cellar/libgit2/1.7.2/lib/libgit2.1.6.dylib' (no such file), '/usr/local/lib/libgit2.1.6.dylib' (no such file), '/usr/lib/libgit2.1.6.dylib' (no such file, not in dyld cache)
zsh: abort exa -1 --classify --group-directories-first
This seems to have started happening after a Homebrew upgrade.
I had hoped this answer would be what I needed, but I couldn't modify it to work for my case.
How can I fix this problem?
Update
Somehow the problem seems to be that the version of libgit2 in that directory is a more recent one but everything is still calling the old version: I went cd /usr/local/opt/libgit2/lib/
and found (using the Finder, not ls
of course) that this directory contains libgit2.1.7.2.dylib
but no libgit2.1.6.dylib
. Maybe I should just make a symlink for that old version? Or would that cause other problems?
I tried brew unlink libgit2
then brew link libgit2
; I tried brew uninstall libgit2
then brew install libgit2
and I tried installing the latest Command Line Tools, restarting the computer, etc. But I still have this problem.
libgit2.1.7
- I was able to get it working by runningbrew doctor
and then resolving some of the issues it noted. For my setup, I ended up having to remove and reinstall some deprecated packages. – Nosewheelbat
utility. Thanks to the hint on thebat
issue page this issue is now resolved for me. The solution was simple - just uninstall and installbat
using Homebrew. – Pet