简体   繁体   English

在OSX 10.7上,ruby-2.0.0-p247的RVM安装失败

[英]RVM installation of ruby-2.0.0-p247 fails on OSX 10.7

I've been trying to install Ruby 2 on my machine running OSX 10.7 via rvm, but run into compilation issues no matter what I try. 我一直在尝试通过rvm在运行OSX 10.7的机器上安装Ruby 2,但无论我尝试什么,都会遇到编译问题。

So far, I've tried using the OSX GCC Installer, have reinstalled Xcode twice (tried the DMG first, then the App store), and have reinstalled the command line tools. 到目前为止,我已经尝试使用OSX GCC安装程序,重新安装Xcode两次(首先尝试DMG,然后是App商店),并重新安装了命令行工具。

Compilation fails for both gcc and clang. gcc和clang的编译都失败了。

Here is what it is failing on (from ~/.rvm/src/ruby-2.0.0-p247/config.log): 这是它失败的原因(来自〜/ .rvm / src / ruby​​-2.0.0-p247 / config.log):

configure:3776: checking whether the C compiler works
configure:3798: /usr/bin/clang  --I/usr/local/opt/freetype/include -L/usr/local/opt/freetype/lib conftest.c  >&5
clang: error: unsupported option '--I/usr/local/opt/freetype/include'

This causes ./configure to output checking whether the C compiler works... no . 这会导致./configure输出checking whether the C compiler works... no

As far as I can see, the correct syntax for the option should be -I , rather than --I - how can I get configure to use the correct option? 据我所知,该选项的正确语法应该是-I ,而不是--I - 如何让configure配置为使用正确的选项?

EDIT: Compiling from source without using rvm results in the same issue. 编辑:从源代码编译而不使用rvm会导致同样的问题。

It turns out that my CPPFLAGS environment variable was the culprit. 事实证明,我的CPPFLAGS环境变量是罪魁祸首。

Running CPPFLAGS='-I/usr/local/opt/freetype/include' rvm install ruby-2.0.0-p247 did the trick. 运行CPPFLAGS='-I/usr/local/opt/freetype/include' rvm install ruby-2.0.0-p247就可以了。

声明:本站的技术帖子网页,遵循CC BY-SA 4.0协议,如果您需要转载,请注明本站网址或者原文地址。任何问题请咨询:yoyou2525@163.com.

 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM