Macports and issues with git
September 29, 2010 § 5 Comments
I was upgrading macports and ruby installation on my mac when I noticed that git stopped working. Every time I ran a git command I got the error below:
dyld: Library not loaded: /opt/local/lib/libiconv.2.dylib
Referenced from: /opt/local/bin/git
Reason: Incompatible library version: git requires version 8.0.0 or later, but libiconv.2.dylib provides version 7.0.0
I checked the libiconv.2.dylib,
> otool-L / opt/local/lib/libiconv.2.dylib
/opt/local/lib/libiconv.2.dylib:
/opt/local/lib/libiconv.2.dylib (compatibility version 8.0.0, current version 8.0.0)
/usr/lib/lib System.B.dylib (compatibility version 1.0.0, current version 125.0.1)
I struggled for hours trying to fix this issue, but was at a loss. Then I viewed already installed libiconv:
> sudo port installed libiconv
The following ports are currently installed:
libiconv@1.13_0
libiconv@1.13.1_0 (active)
I tried switching back to the older version
> sudo port activate libiconv@1.13_0
And voila, the switch resolved the issue. Hope this helps people that encounter this.
Thanks man, you saved me a ton of time tracking down a solution.
You are most welcome. It was a tough one for me to figure out 🙂 glad it helped you.
My problem wasn’t with git, but with gnuplot, but after changing the library version I can use gnuplot but not git:
~ > git st
dyld: Library not loaded: /opt/local/lib/libiconv.2.dylib
Referenced from: /opt/local/bin/git
Reason: Incompatible library version: git requires version 8.0.0 or later, but libiconv.2.dylib provides version 7.0.0
Trace/BPT trap
If I change back to libiconv@1.13_0, git works but gnuplot doesn’t. Any ideas?
In case ayone is interested, I found the solution. Reinstall git using macports:
sudo port install git-core
i was gonna suggest that you do a port uninstall and install of git. you figured it out 🙂