7

在我这样做之后:

酿造安装 git

我这样做:

哪个混帐

返回:

/usr/local/bin/git

然后我这样做:

文件 /usr/local/bin/git

返回:

/usr/local/bin/git: Mach-O 可执行 i386

我需要 brew 安装为 x86_64。

如何强制 brew 将我的应用程序构建和安装为 x86_64?

酿造--配置

返回这个:

HOMEBREW_VERSION: 0.9
HEAD: 1c64a6624ed83ef17af6e98638b8165400e9e908
HOMEBREW_PREFIX: /usr/local
HOMEBREW_CELLAR: /usr/local/Cellar
CPU: quad-core 64-bit sandybridge
OS X: 10.7.4
Kernel Architecture: x86_64
Xcode: 4.3.2
GCC-4.0: N/A
GCC-4.2: N/A
LLVM: build 2336
Clang: 3.1 build 318
MacPorts or Fink? false
X11: /usr/X11
System Ruby: 1.8.7-357
Which Perl:   /usr/bin/perl
Which Python: /usr/bin/python
Which Ruby:   /Users/tdewell/.rvm/rubies/ruby-1.9.3-p194/bin/ruby

更新:添加 brew --env

$ brew --env
CC: /usr/bin/xcrun gcc-4.2 => /Developer/usr/bin/gcc-4.2

CXX: /usr/bin/xcrun g++-4.2 => /Developer/usr/bin/g++-4.2

LD: /usr/bin/xcrun gcc-4.2 => /Developer/usr/bin/gcc-4.2

CFLAGS: -Os -w -pipe -march=core2 -msse4
CXXFLAGS: -Os -w -pipe -march=core2 -msse4
MAKEFLAGS: -j4
4

2 回答 2

4

这已经解决了。

我通过 App Store 安装了 Xcode 4.3.2 并安装了命令行工具,但我多年前安装了现有的 Xcode 3.1。我搜索了一下,发现了这些命令:

sudo /Developer/Library/uninstall-devtools –mode=all

sudo xcode-select -switch /Applications/Xcode.app/Contents/Developer

这解决了我的问题,在我这样做之后,编译器更改为 brew:

$ brew --env
CC: /usr/bin/clang
CXX: /usr/bin/clang++ => /usr/bin/clang
LD: /usr/bin/clang
CFLAGS: -Os -w -pipe -march=native -Qunused-arguments
CXXFLAGS: -Os -w -pipe -march=native -Qunused-arguments
MAKEFLAGS: -j4

brew 安装现在好多了:

$ which git
/usr/local/bin/git

$ file /usr/local/bin/git
/usr/local/bin/git: Mach-O 64-bit executable x86_64
于 2012-06-08T20:32:34.440 回答
-1

尝试

xcode-select --install
于 2016-12-09T10:14:25.067 回答