自制啤酒在“上失败;命令‘;gcc’;失败,退出状态为1″;错误

自制啤酒在“上失败;命令‘;gcc’;失败,退出状态为1″;错误,gcc,homebrew,gdal,Gcc,Homebrew,Gdal,我想开始使用geodjango,为此我必须安装gdal。我正在使用MacOS 10.8.3 为了按照geodjango文档中的建议使用brew,我遇到以下错误: $brew install gdal ==> Downloading http://download.osgeo.org/gdal/1.10.0/gdal-1.10.0.tar.gz Already downloaded: /Library/Caches/Homebrew/gdal-1.10.0.tar.gz ==> ./

我想开始使用geodjango,为此我必须安装gdal。我正在使用MacOS 10.8.3 为了按照geodjango文档中的建议使用brew,我遇到以下错误:

$brew install gdal 
==> Downloading http://download.osgeo.org/gdal/1.10.0/gdal-1.10.0.tar.gz
Already downloaded: /Library/Caches/Homebrew/gdal-1.10.0.tar.gz
==> ./configure --prefix=/usr/local/Cellar/gdal/1.10.0 --mandir=/usr/local/Cellar/gdal/1.10.0/share/man --with-local=/usr/local/Cellar/gdal/1.10.0 --with-threads --with-libtool -
==> make
==> make install
==> /Users/Lucas/.virtualenvs/geotest/bin/python setup.py install --prefix=/usr/local/Cellar/gdal/1.10.0 --record=installed.txt --single-version-externally-managed
gcc-4.2 -bundle -undefined dynamic_lookup -g -L/usr/local/opt/sqlite/lib -lsqlite3 -I/usr/local/opt/sqlite/include -arch x86_64 build/temp.macosx-10.6-intel-2.7/extensions/gdalconst_wrap.o -L../../.libs -L../../ -L/private/tmp/gdal-gOux/gdal-1.10.0/lib -lgdal -o build/lib.macosx-10.6-intel-2.7/osgeo/_gdalconst.so
Your Xcode and or CLT are mis-configured. Try some or all of the following:
    xcodebuild -license
    sudo xcode-select -switch /path/to/Xcode.app
error: command 'gcc-4.2' failed with exit status 1
READ THIS: https://github.com/mxcl/homebrew/wiki/troubleshooting

These open issues may also help:
    https://github.com/mxcl/homebrew/issues/19845
    https://github.com/mxcl/homebrew/issues/20373
    https://github.com/mxcl/homebrew/pull/20457
按照建议,我做到了:

xcodebuild -license
并同意许可证,然后:

sudo xcode-select -switch /Applications/Xcode.app
我也检查了问题,但没有一个是有用的

我已经安装了Xcode 4.6.3,并且在过去酿造了很多其他配方,没有任何问题

当我运行brew doctor时,我得到:

$brew doctor
Warning: "config" scripts exist outside your system or Homebrew directories.
`./configure` scripts often look for *-config scripts to determine if
software packages are installed, and what additional flags to use when
compiling and linking.

Having additional scripts in your path can confuse software installed via
Homebrew if the config script overrides a system or Homebrew provided
script of the same name. We found the following "config" scripts:

    /Library/Frameworks/Python.framework/Versions/2.7/bin/python-config
    /Library/Frameworks/Python.framework/Versions/2.7/bin/python2-config
    /Library/Frameworks/Python.framework/Versions/2.7/bin/python2.7-config
    /Applications/Postgres.app/Contents/MacOS/bin/gdal-config
    /Applications/Postgres.app/Contents/MacOS/bin/geos-config
    /Applications/Postgres.app/Contents/MacOS/bin/uuid-config
    /Applications/Postgres.app/Contents/MacOS/bin/xml2-config
我不想从路径中删除postgres.app,因为这是postgres.app配置CLI所必需的,如下所述:

关于python from库,我尝试使用以下方法删除它们:

PATH=$(echo $PATH |sed 's/\/Library\/Frameworks\/Python.framework\/Versions\/2.7\/bin//')
如此处所述:。但它并没有从这条道路上移除任何东西


因此,这里我没有安装gdal…

我找到了一个解决方法,因此,我找不到原始帖子,但在这篇文章中给出了类似的信息:

因此,我在.bashrc中添加了以下行,然后我成功地brew安装了gdal

export CC=gcc
export CXX=g++

请注意,这并没有完全解决我的问题,因为我仍然存在geodjango的配置问题,但至少我安装了gdal。

也有这个问题。如果您找到了解决方案/解决方法,请告诉我。当然,如果您先找到答案,请回答我的问题。