完成此操作后:
brew install git
我这样做:
哪个git
返回:
的/ usr / local / bin中/ GIT中
然后我这样做:
file / usr / local / bin / git
返回:
/ usr / local / bin / git:Mach-O可执行文件i386
我需要brew安装为x86_64。
如何强制brew构建并将我的应用程序安装为x86_64?
brew --config
返回:
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
答案 0 :(得分:4)
这已经解决了。
我通过App Store安装了Xcode 4.3.2并安装了命令行工具,但是我已经安装了多年前的Xcode 3.1。我用Google搜索并找到了这些命令:
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
答案 1 :(得分:-1)
尝试
xcode-select --install