0

Running OSX 10.4 (Yosemite)

I get this error when I run "git {command}" as a user:

dyld: Symbol not found: __cg_jpeg_resync_to_restart
  Referenced from: /System/Library/Frameworks/ImageIO.framework/Versions/A/ImageIO
  Expected in: /opt/local/lib/libJPEG.dylib
 in /System/Library/Frameworks/ImageIO.framework/Versions/A/ImageIO
git: error: unable to locate xcodebuild, please make sure the path to the Xcode folder is set correctly!
git: error: You can set the path to the Xcode folder using /usr/bin/xcode-select -switch

When running "sudo git {command}", everything works fine. Not sure what's wrong. I'm guessing it's some kind of install issue, linking issue or permissions issue. Anyone know whats going on/how to fix?

UPDATE:

Following the post listed below, I was able to make git calls without being the root, but am still encountering linking errors:

Cloning into 'master'...
dyld: lazy symbol binding failed: Symbol not found: _iconv_open
  Referenced from: /usr/local/bin/git
  Expected in: /opt/local/lib/libiconv.2.dylib

dyld: Symbol not found: _iconv_open
  Referenced from: /usr/local/bin/git
  Expected in: /opt/local/lib/libiconv.2.dylib

It would seem there's something majorly wrong with the linking here, anyone know what's going on?

  • Seems quite similar to this question asked in 2013: http://stackoverflow.com/questions/19647788/why-is-this-git-command-line-broken-after-a-fresh-os-x-mavericks-upgrade – Sterling Bourne Nov 20 '15 at 19:33
  • Thanks! Followed the instructions but encountered new error, seems to be related to linking still.... –  Nov 20 '15 at 20:06

1 Answers1

0

It looks like /usr/local/bin appears in your $PATH before /usr/bin, so /usr/local/bin/git is found before /usr/bin/git (sudo resets $PATH to a predefined value that doesn't generally contain /usr/local, so that's why it works). Try and see if /usr/bin/git works better for you.

That said, it also appears that /usr/local/bin/git is broken. It looks like it was installed by a third party package manager (MacPorts would be my guess).

I would suggest to either just remove it (sudo port -fp uninstall git, although I'm unfamiliar with MacPorts and lifted that command line from its documentation, so it may not work) or to try to reinstall it to fix the issues you encounter.

robertklep
  • 198,204
  • 35
  • 394
  • 381