Brew安装Ruby-Build失败:无法运行C编译的程序

时间:2015-06-16 15:33:34

标签: ruby gem homebrew

我正在尝试使用Homebrew安装ruby,但每次尝试我都会得到这个:

==> Installing dependencies for ruby-build: pkg-config, makedepend, opens
==> Installing ruby-build dependency: pkg-config
==> Downloading http://pkgconfig.freedesktop.org/releases/pkg-config-0.28.tar.gz
Already downloaded: /Library/Caches/Homebrew/pkg-config-0.28.tar.gz
==> ./configure --prefix=/usr/local/Cellar/pkg-config/0.28 --disable-host-tool -
checking for suffix of executables... 
checking whether we are cross compiling... configure: error: in `/private/tmp/pkg-config20150616-3766-1f5xqh9/pkg-config-0.28':
configure: error: cannot run C compiled programs.
If you meant to cross compile, use `--host'.
See `config.log' for more details

我该怎么办?

2 个答案:

答案 0 :(得分:1)

如果你安装xcode-beta,你应该像这样运行:

  

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

答案 1 :(得分:0)

尝试运行此命令:xcode-select --install。它对我有用