Brew安装git失败

时间:2012-10-19 08:51:05

标签: macos git gcc homebrew

我想用自制软件安装git。我安装了MacPorts,我从iMac中删除了它。我还完全删除了自制软件,并使用ruby -e "$(curl -fsSkL raw.github.com/mxcl/homebrew/go)"重新安装了它。

在我运行brew doctor后,我不得不删除(我只是移动它们)/usr/local/lib内的一些库。之后,我修复了$PATH中的.profile var,以便/usr/local/bin/usr/local/sbin覆盖正常的bin目录。

现在我想用brew install git安装git。它获取了内容,并开始构建git。但是在构建期间,它失败并显示消息

~$ brew install git
spo==> Downloading http://git-core.googlecode.com/files/git-1.7.12.4.tar.gz
Already downloaded: /Library/Caches/Homebrew/git-1.7.12.4.tar.gz
==> make prefix=/usr/local/Cellar/git/1.7.12.4 CC=/usr/bin/gcc-4.2 CFLAGS=-Os -w -pipe -march=core2 -msse4.1 -mmacosx-version
ld: symbol(s) not found
collect2: ld returned 1 exit status
make: *** [git-credential-store] Error 1
make: *** Waiting for unfinished jobs....
Writing perl.mak for Git

Error: git did not build
Logs: /Users/23tux/Library/Logs/Homebrew/git/
Help: https://github.com/mxcl/homebrew/wiki/troubleshooting
      https://github.com/mxcl/homebrew/issues/11481
      https://github.com/mxcl/homebrew/issues/14423
      https://github.com/mxcl/homebrew/issues/14585

我查看/Users/23tux/Library/Logs/Homebrew/git/并说它有未定义的符号。这是输出:

/usr/bin/gcc-4.2  -Os -w -pipe -march=core2 -msse4.1 -mmacosx-version-min=10.6 -I. -DPRECOMPOSE_UNICODE -DUSE_ST_TIMESPEC -DNO_GETTEXT  -DHAVE_DEV_TTY -DSHA1_HEADER='<openssl/sha.h>'  -DNO_MEMMEM -DSHELL_PATH='"/bin/sh"' -o git-credential-store -L/usr/local/lib  credential-store.o libgit.a xdiff/lib.a  -lz  -liconv  -lcrypto -lssl 
Undefined symbols:
  "_strbuf_addstr_urlencode", referenced from:
      _main in credential-store.o
      _main in credential-store.o
      _main in credential-store.o
      _main in credential-store.o
  "_strbuf_getline", referenced from:
      _parse_credential_file in credential-store.o
  "_strbuf_release", referenced from:
      _parse_credential_file in credential-store.o
      _main in credential-store.o
  "_credential_clear", referenced from:
      _parse_credential_file in credential-store.o
  "_usage_with_options", referenced from:
      _main in credential-store.o
  "_credential_from_url", referenced from:
      _parse_credential_file in credential-store.o
  "_credential_read", referenced from:
      _main in credential-store.o
  "_commit_lock_file", referenced from:
      _rewrite_credential_file in credential-store.o
  "_die_errno", referenced from:
      _parse_credential_file in credential-store.o
      _rewrite_credential_file in credential-store.o
  "_credential_match", referenced from:
      _parse_credential_file in credential-store.o
  "_strbuf_slopbuf", referenced from:
      _parse_credential_file in credential-store.o
      _main in credential-store.o
  "_expand_user_path", referenced from:
      _main in credential-store.o
  "_parse_options", referenced from:
      _main in credential-store.o
  "_write_or_die", referenced from:
      _print_line in credential-store.o
  "_die", referenced from:
      _main in credential-store.o
  "_strbuf_addf", referenced from:
      _main in credential-store.o
  "_hold_lock_file_for_update", referenced from:
      _rewrite_credential_file in credential-store.o
  "_strbuf_grow", referenced from:
      _print_line in credential-store.o
      _main in credential-store.o
      _main in credential-store.o
      _main in credential-store.o
ld: symbol(s) not found
collect2: ld returned 1 exit status
make: *** [git-credential-store] Error 1
make: *** Waiting for unfinished jobs....
Writing perl.mak for Git

HOMEBREW_VERSION: 0.9.3
HEAD: (none)
CPU: dual-core 64-bit penryn
OS X: 10.6.8-i386
Xcode: 3.2.6
X11: 2.3.6 => /usr/X11

(输出更长,我只包括发生错误的最后几行。)

我google了很多,但找不到任何解决方案。这是因为MacPorts的一些破碎的东西(我知道,他们彼此不喜欢)?或者我该如何解决这个问题?

修改

我刚刚发现,当我正在运行brew doctor时,我得到了这个输出:

You must: brew install git
You must: brew install git
You must: brew install git
Warning: An outdated version of Git was detected in your PATH.
Git 1.6.6 or newer is required to perform checkouts over HTTP from GitHub.
Please upgrade: brew upgrade git

当我运行brew upgrade git时,我得到Error: git not installed。我搜索了我的PATH var中的任何二进制git(或其他东西),但找不到任何东西。

我认为这意味着,某处存在git东西,并且它与新安装冲突。我是对的吗?

1 个答案:

答案 0 :(得分:2)

在这种情况下,我无法弄清楚如何使用自制软件安装git。因为我不想浪费那么多时间,我从这里http://railsinstaller.org/安装了Rails安装程序的整个rvm,ruby,git。然后它与自制软件一起工作