Question

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.

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.

Compilation fails for both gcc and clang.

Here is what it is failing on (from ~/.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.

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?

EDIT: Compiling from source without using rvm results in the same issue.

Was it helpful?

Solution

It turns out that my CPPFLAGS environment variable was the culprit.

Running CPPFLAGS='-I/usr/local/opt/freetype/include' rvm install ruby-2.0.0-p247 did the trick.

Licensed under: CC-BY-SA with attribution
Not affiliated with StackOverflow
scroll top