Forum: Ruby ruby.h error on OS X

Announcement (2017-05-07): www.ruby-forum.com is now read-only since I unfortunately do not have the time to support and maintain the forum any more. Please see rubyonrails.org/community and ruby-lang.org/en/community for other Rails- und Ruby-related community platforms.
149379873fe2cb70e550c6bff8fedd0c?d=identicon&s=25 Jeff Schwab (Guest)
on 2009-03-02 18:25
(Received via mailing list)
Has anyone else had problems with the ruby 1.9.1 development headers on
OS X?

$ 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’
$
F1d6cc2b735bfd82c8773172da2aeab9?d=identicon&s=25 Nobuyoshi Nakada (nobu)
on 2009-03-02 20:46
(Received via mailing list)
Hi,

At Tue, 3 Mar 2009 02:23:47 +0900,
Jeff Schwab 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
/System/Library/Frameworks/ruby.framework/Headers/config.h.
This topic is locked and can not be replied to.