# Ruby.h error on OS X

**URL:** <https://www.ruby-forum.com/t/ruby-h-error-on-os-x/161812>\
**Category:** Ruby\
**Created:** [March 2, 2009, 6:25pm UTC](https://www.ruby-forum.com/t/ruby-h-error-on-os-x/161812 "2009-03-02T18:25:53Z")\
**Posts on this page:** 2\
**Page:** 1

<div class="post-metadata">

**Author:** ![sprsquish](https://www.ruby-forum.com/letter_avatar_proxy/v4/letter/s/d9b06d/32.png) [@sprsquish](https://www.ruby-forum.com/u/sprsquish)\
**Post date:** [March 2, 2009, 6:25pm UTC](https://www.ruby-forum.com/t/ruby-h-error-on-os-x/161812/1 "2009-03-02T18:25:53Z")

</div>

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’  
$

---

<div class="post-metadata">

**Author:** ![sprsquish](https://www.ruby-forum.com/letter_avatar_proxy/v4/letter/s/d9b06d/32.png) [@sprsquish](https://www.ruby-forum.com/u/sprsquish)\
**Post date:** [March 2, 2009, 8:46pm UTC](https://www.ruby-forum.com/t/ruby-h-error-on-os-x/161812/2 "2009-03-02T20:46:49Z")

</div>

Hi,

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  
/System/Library/Frameworks/ruby.framework/Headers/config.h.
