在 OSX 10.9 上安装 Homebrew

在 OSX 10.9 上安装 Homebrew

我正在尝试使用以下命令安装 Homebrew:

ruby -e "$(curl -fsSL https://raw.github.com/Homebrew/homebrew/go/install)"

# Add Homebrews binary path to the front of the $PATH
echo 'export PATH=/usr/local/bin:$PATH' >> ~/.bash_profile
source ~/.bash_profile

一切似乎都正常,但是当我用

brew doctor

我收到此错误:

Error: No such file or directory - /Library/Developer/CommandLineTools/usr/bin/clang

我一直在研究这个问题,它看起来是 OSX 10.10 中出现的问题,但我没有使用过。问题可能出在哪里?

顺便说一句,我试图让 Ruby on rails 与 clang 而不是 gcc 一起工作(因为它无法与后者一起工作),所以重新安装后出现了这个问题。是否有一些配置可以用来切换回 gcc?

编辑1:

当我跑步时

xcodebuild -find clang

我明白了

/Applications/Xcode.app/Contents/Developer/Toolchains/XcodeDefault.xctoolchain/usr/bin/clang

当我跑步时

which clang

我明白了

/usr/bin/clang

跑步

locate clang | egrep clang$

我明白了

/Applications/Xcode.app/Contents/Developer/Toolchains/XcodeDefault.xctoolchain/usr/bin/clang
/Applications/Xcode.app/Contents/Developer/Toolchains/XcodeDefault.xctoolchain/usr/lib/clang
/System/Library/Frameworks/OpenCL.framework/Versions/A/lib/clang
/opt/local/var/macports/sources/rsync.macports.org/release/tarballs/ports/science/mpich/files/mpich-clang
/opt/local/var/macports/sources/rsync.macports.org/release/tarballs/ports/science/mpich/files/mpich-devel-clang
/opt/local/var/macports/sources/rsync.macports.org/release/tarballs/ports/science/openmpi/files/openmpi-clang
/opt/local/var/macports/sources/rsync.macports.org/release/tarballs/ports/science/openmpi/files/openmpi-devel-clang
/usr/bin/clang
/usr/local/Library/ENV/4.3/clang

然后我尝试访问开发者网站并下载 Xcode 命令行工具并重新安装。然后安装成功。

因此,我继续说道:

brew update
brew install rbenv ruby-build rbenv-gem-rehash
echo 'eval "$(rbenv init -)"' >> ~/.bash_profile
source ~/.bash_profile
rbenv install 2.1.2
rbenv rehash
rbenv global 2.1.2
gem install bundler

最后一个命令给出了以下输出:

ERROR:  Loading command: install (LoadError)
cannot load such file -- zlib
ERROR:  While executing gem ... (NoMethodError)
undefined method `invoke_with_build_args' for nil:NilClass

我认为这意味着系统上没有安装 zlib。

我尝试找到一种安装方法,但 Homebrew 找不到它。有什么想法吗?

相关内容