GIT error with Mac OS X: dyld: Lazy Symbol Binding failed: Symbol not found: _iconv_open

Asked

Viewed 146 times

3

I’m trying to use GIT from the terminal (Mac OS X), but the following error is appearing:

$ git help
dyld: lazy symbol binding failed: Symbol not found: _iconv_open
  Referenced from: /Library/Developer/CommandLineTools/usr/bin/git
  Expected in: /Library/PostgreSQL/9.3/lib/libiconv.2.dylib

dyld: Symbol not found: _iconv_open
  Referenced from: /Library/Developer/CommandLineTools/usr/bin/git
  Expected in: /Library/PostgreSQL/9.3/lib/libiconv.2.dylib

I’ve reinstalled the command line tools and the error still persists when using some command git

In my .bashrc I am using the following path...:

export DYLD_LIBRARY_PATH=/Library/PostgreSQL/9.3/lib

...because I am using virtualenv and the virtual environment was not being able to identify postgresql, I already commented this line and restarted the machine and still continues the same error. Despite some solutions on the internet, I did not find one that would solve my question.

2 answers

2

Try pointing the variable to a real path from the iconv in your system.

Assuming your system has a version of the /usr/lib (on my OS X Mavericks it’s there, but I installed a lot of extra stuff on it, so I can’t confirm if this is standard):

export DYLD_LIBRARY_PATH=/usr/lib

Additionally that reply from Soen (and the comment on Chris.Zou) suggest adding the location of the iconv at the beginning of PATH also. Assuming you’re using the version of Git installed next to Xcode, the path /usr/bin already has high priority, but in installations by Brew this can solve.

export PATH=/usr/local/bin:$PATH

And as per the comment, for installations through the Git website this can help:

export PATH=/usr/local/git/bin:$PATH
  • The same problem was because I had referenced the DYLD_LIBRARY_PATH to another path in the file .profile, but thanks for the collaboration.

  • 1

    Oops, I didn’t see you had found the problem of "remains of paths" postgrsql when posted. I’ll leave the answer anyway because I believe it can help other users in the same situation.

1


I solved the problem, I found that in addition to the file .bashrc there was the file .profile with export DYLD_LIBRARY_PATH=/Library/PostgreSQL/9.3/lib, I commented on this line and the problem was solved.

Note: to not stop using DYLD to work postgresql, I created a fallback in.profile':

export DYLD_FALLBACK_LIBRARY_PATH=/Library/PostgreSQL/9.3/lib:$DYLD_LIBRARY_PATH

With this the standard path export DYLD_LIBRARY_PATH=/usr/lib is working (which does not cause problems in GIT) and at the same time it is possible to use postgresql without having problems.

Browser other questions tagged

You are not signed in. Login or sign up in order to post.