如何在OSX的git上修复权限/链接路径

时间:2015-11-20 19:26:18

标签: git macos

运行OSX 10.4(Yosemite)

我在运行" git {command}"时出现此错误作为用户:

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

当运行" sudo git {command}"时,一切正常。不确定是什么错。我猜它是某种安装问题,导致问题或权限问题。有谁知道发生了什么/如何解决?

更新:

按照下面列出的帖子,我能够在不作为root的情况下进行git调用,但仍然遇到链接错误:

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

这里的链接似乎有一些重大错误,任何人都知道发生了什么?

1 个答案:

答案 0 :(得分:0)

$PATH之前/usr/bin中显示/usr/local/bin/git似乎/usr/bin/git,因此在sudo之前找到$PATH/usr/local重置{{1}预定义的值通常不包含/usr/bin/git,这就是它工作的原因)。试着看看/usr/local/bin/git是否适合您。

也就是说,sudo port -fp uninstall git似乎也被打破了。看起来它是由第三方软件包管理器安装的(MacPorts是我的猜测)。

我建议您删除它({{1}},虽然我不熟悉MacPorts并从其文档中提取该命令行,因此可能无效)或尝试重新安装以修复它你遇到的问题。