我正在尝试安装Ruby 1.9.3,但是遇到了问题。我安装了RVM,然后输入:
rvm install 1.9.3
输出为:
ERROR: Error running ' ./configure....
日志上写着:
configure: WARNING: unrecognized options: --with-libyaml-dir
checking build system type... x86_64-apple-darwin11.2.0
checking host system type... x86_64-apple-darwin11.2.0
checking target system type...x86_64-apple-darwin11.2.0
checking whether the C compiler works... no
configure: error: in `/Users/myuser/.rvm/src/ruby-1.9.3-p0':
configure: error: C compiler cannot create executables See `config.log' for more details
我从应用商店下载了新的XCode并安装了它。
发布于 2011-11-23 13:48:09
尝试使用clang编译器而不是默认编译器:
rvm install 1.9.3 --with-gcc=clang
发布于 2012-02-16 18:21:28
RVM需要gcc-4.2才能安装ruby 1.9.3。不幸的是,Lion不再包含gcc-4-2,只包含llvm版本:
lrwxr-xr-x 1 root wheel 12 15 feb 17:21 /usr/bin/gcc -> llvm-gcc-4.2
如果你使用的是Lion,但从雪豹升级而来,很可能你仍然使用的是gcc-4.2,如果你有一个全新的Lion安装,你应该下载gcc-4.2。我推荐下载这个包。
https://github.com/kennethreitz/osx-gcc-installer
检查您现在是否安装了gcc-4.2:
-rwxr-xr-x 1 root wheel 113024 16 may 2011 /usr/bin/gcc-4.2
lrwxr-xr-x 1 root wheel 12 15 feb 17:21 /usr/bin/gcc -> llvm-gcc-4.2
现在你可以照常安装ruby 1.9.3了:
rvm install 1.9.3
rvm use 1.9.3 --default
发布于 2012-02-16 19:13:34
如果您只想安装并保持最新版本的Ruby (而不是在不同版本的ruby之间切换),则可以通过homebrew安装ruby。
brew install ruby
https://stackoverflow.com/questions/8139138
复制相似问题