Forum: Ruby ruby.h error on OS X

Announcement (2017-05-07): is now read-only since I unfortunately do not have the time to support and maintain the forum any more. Please see and for other Rails- und Ruby-related community platforms.
Jeff S. (Guest)
on 2009-03-02 19:25
(Received via mailing list)
Has anyone else had problems with the ruby 1.9.1 development headers on

$ echo '#include "ruby.h"' >main.c
$ gcc -c main.c
In file included from /Users/jeff/usr/include/ruby/ruby.h:1125,
                  from /Users/jeff/usr/include/ruby.h:32,
                  from main.c:1:
/Users/jeff/usr/include/ruby/missing.h:35: error: redefinition of
‘struct timespec’
Nobuyoshi N. (Guest)
on 2009-03-02 21:46
(Received via mailing list)

At Tue, 3 Mar 2009 02:23:47 +0900,
Jeff S. wrote in [ruby-talk:330122]:
> $ echo '#include "ruby.h"' >main.c
> $ gcc -c main.c

You need to add -I option for platform specific headers, maybe
-I $HOME/usr/include/`uname -m`-darwin`uname -r`.  mkmf.rb
should deal with it.

Apple has added a strange hack to gcc in their port so it reads
ruby/missing.h from
This topic is locked and can not be replied to.