尝试使用警告安装Ruby 1.9.3-p547退出:无法识别的选项: - with-libyaml-dir, - with-readline-dir

时间:2014-05-28 09:50:08

标签: ruby gcc osx-mavericks rbenv

我一直在尝试使用rbenv在OS X 10.9.3上安装Ruby 1.9.3-p547:

CC="/usr/local/Cellar/gcc/4.8.3/bin/gcc" rbenv install 1.9.3-p547

但它一直报告错误:

Installing ruby-1.9.3-p547...

BUILD FAILED

Inspect or clean up the working tree at /var/folders/6t/33jmvscd6vg_tlqk40c4vsg80000gp/T/ruby-build.20140528111136.82977
Results logged to /var/folders/6t/33jmvscd6vg_tlqk40c4vsg80000gp/T/ruby-build.20140528111136.82977.log

Last 10 log lines:
x ruby-1.9.3-p547/golf_prelude.c
/var/folders/6t/33jmvscd6vg_tlqk40c4vsg80000gp/T/ruby-build.20140528111136.82977/ruby-1.9.3-p547 /var/folders/6t/33jmvscd6vg_tlqk40c4vsg80000gp/T/ruby-build.20140528111136.82977  ~/code/dpplus
configure: WARNING: unrecognized options: --with-libyaml-dir, --with-readline-dir
checking build system type... x86_64-apple-darwin13.2.0
checking host system type... x86_64-apple-darwin13.2.0
checking target system type... x86_64-apple-darwin13.2.0
checking whether the C compiler works... no
configure: error: in `/var/folders/6t/33jmvscd6vg_tlqk40c4vsg80000gp/T/ruby-    build.20140528111136.82977/ruby-1.9.3-p547':
configure: error: C compiler cannot create executables
See `config.log' for more details

BUILD FAILED

Inspect or clean up the working tree at /var/folders/6t/33jmvscd6vg_tlqk40c4vsg80000gp/T/ruby-build.20140528111136.82977
Results logged to /var/folders/6t/33jmvscd6vg_tlqk40c4vsg80000gp/T/ruby-build.20140528111136.82977.log

Last 10 log lines:
/var/folders/6t/33jmvscd6vg_tlqk40c4vsg80000gp/T/ruby-build.20140528111136.82977/ruby-1.9.3-p547 /var/folders/6t/33jmvscd6vg_tlqk40c4vsg80000gp/T/ruby-build.20140528111136.82977 ~/code/dpplus
configure: WARNING: unrecognized options: --with-libyaml-dir, --with-readline-dir
checking build system type... x86_64-apple-darwin13.2.0
checking host system type... x86_64-apple-darwin13.2.0
checking target system type... x86_64-apple-darwin13.2.0
checking whether the C compiler works... no
configure: error: in `/var/folders/6t/33jmvscd6vg_tlqk40c4vsg80000gp/T/ruby-    build.20140528111136.82977/ruby-1.9.3-p547':
configure: error: C compiler cannot create executables
See `config.log' for more details
make: *** No targets specified and no makefile found.  Stop.

我一直在尝试使用gcc 4.8.3,gcc 4.6,readline和libyaml(全部来自Homebrew)。它适用于apple-gcc42(也来自Homebrew),但这给Spring-gem带来了问题。

1 个答案:

答案 0 :(得分:2)

我遇到了同样的问题而且我缺少Xcode命令行工具。我已使用以下命令安装它:

xcode-select --install

希望这会对你有所帮助。