Git 错误:dyld:懒惰的符号绑定失败:找不到符号:_iconv_open

声明:本页面是StackOverFlow热门问题的中英对照翻译,遵循CC BY-SA 4.0协议,如果您需要使用它,必须同样遵循CC BY-SA许可,注明原文地址和作者信息,同时你必须将它归于原作者(不是我):StackOverFlow 原文地址: http://stackoverflow.com/questions/19455727/
Warning: these are provided under cc-by-sa 4.0 license. You are free to use/share it, But you must attribute it to the original authors (not me): StackOverFlow

提示:将鼠标放在中文语句上可以显示对应的英文。显示中英文
时间:2020-09-19 09:13:56  来源:igfitidea点击:

Git Error: dyld: lazy symbol binding failed: Symbol not found: _iconv_open

macosgitlibiconv

提问by JustNeph

I was trying to fix up my .bashrcon a new mac with some aliases I had and I had made a .bash_profileto try to load up the .bashrcwhen the terminal was opened. However, it has been giving me this error every time I try to use a gitcommand.

我试图.bashrc在一台新的 mac 上修复我的一些别名,我已经做了一个.bash_profile尝试.bashrc在终端打开时加载。但是,每次我尝试使用git命令时,它都会给我这个错误。

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

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

Trace/BPT trap: 5

I deleted the .bash_profileand even reverted back the .bashrcbut still no good. Any ideas?

我删除了.bash_profile,甚至恢复了,.bashrc但仍然没有好处。有任何想法吗?

Side Note: I have looked at Git > dyld: lazy symbol binding failed: Symbol not found: _iconv_openbut his solution doesn't seem to work for me as I have no bash_profile at all now.

旁注:我看过Git > dyld: lazy symbol binding failed: Symbol not found: _iconv_open但他的解决方案似乎对我不起作用,因为我现在根本没有 bash_profile 。

采纳答案by JustNeph

Coworker figured it out for my situation.

同事根据我的情况解决了这个问题。

Create a file ~/.bash_profileand in it put

创建一个文件~/.bash_profile并将其放入

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

That seemed to fix it. Seems the issue was with the path.

这似乎解决了它。似乎问题出在路径上。

回答by Kiki Jewell

Note, I just answered a similar issue. Bottom line is there is a broken version of gitinstalled on your computer in /usr/local/git/bin. Uninstall that one to be certain you won't get this problem. (I had fixed it on the command line but not in PyCharm -- annoying!)

注意,我刚刚回答了一个类似的问题。最重要的是git,您的计算机上安装了/usr/local/git/bin. 卸载那个以确保您不会遇到此问题。(我已经在命令行中修复了它,但没有在 PyCharm 中修复它——烦人!)

More specific info in my answer here:

我在这里的回答中有更具体的信息:

Git commands not working in Mac terminal: "dyld: Symbol not found: ___strlcpy_chk" error

Git 命令在 Mac 终端中不起作用:“dyld:找不到符号:___strlcpy_chk”错误