My environment: Mac OS X v10.7.2 with Xcode 4.2.1

I am trying to build ruby 1.9.3 on Lion with Xcode 4.2.1. I understand there's an issue with the llvm-based gcc compiler that comes with Xcode 4.2.1. But I'm trying to work around it by following these instructions, http://goo.gl/Sc39g. I was able to get a little farther along, but then ran into these 2 problems:

  1. #error Please add -D_FILE_OFFSET_BITS=64 to your compile flags!
  2. fatal error: 'sys/statfs.h' file not found

The complete configure output is here: http://cl.ly/2q2G3p3r3S133i0U1i1e (the errors are all the way in the bottom)

Please advise. Thanks in advance.

P.S. I've read the list of similar/related questions, but none seem to address these 2 particular errors, or I missed them as my eyes are starting to glaze over from all the things I've tried to get this build to work. If this question has already been answered, please point me to the answer, and accept my apologies for the duplication.

有帮助吗?

解决方案

Have you tried to add the flag?

$ make clean
$ ./configure --with-gcc=clang --prefix=$HOME/.rbenv/versions/1.9.2-p290 CFLAGS=-D_FILE_OFFSET_BITS=64

Did you install macfuse? If yes is this thread useful?

Or if you don't mind installing gcc and brew, you should have more luck compiling ruby with rbenv or rvm. This article show you how to install 1.9.3 with gcc and rbenv.

其他提示

clang will probably break your gems down the line. Try with gcc like so:

$ CC=/usr/bin/gcc-4.2 rbenv install 1.9.3-p0
许可以下: CC-BY-SA归因
不隶属于 StackOverflow
scroll top