Search code examples
rubyrubygemsrubyosa

Ruby OSA gem install problem


Trying to install rubyOSA on my iMac

sudo gem install rubyosa

I get the following error:

ERROR:  Error installing rubyosa:
    ERROR: Failed to build gem native extension.

/System/Library/Frameworks/Ruby.framework/Versions/1.8/usr/bin/ruby extconf.rb
mkmf.rb can't find header files for ruby at /System/Library/Frameworks/Ruby.framework/Versions/1.8/usr/lib/ruby/ruby.h


Gem files will remain installed in /Library/Ruby/Gems/1.8/gems/rubyosa-0.4.0 for inspection.
Results logged to /Library/Ruby/Gems/1.8/gems/rubyosa-0.4.0/gem_make.out

Solution

  • I've had this error show a lot of times while installing gems. I found out later that I needed the development package that included all the needed headers for compilation. On a debian machine they are in the ruby-dev package.

    I was reading on the Internet that OS X ships the headers with XCode, so you might need to get them from there.

    I found this link that might be of help to you: http://www.fngtps.com/2009/08/missing-ruby-headers-after-snow-leopard-upgrade [EDIT: original link broken, here's the internet archive of the page: https://web.archive.org/web/20100327201647/http://www.fngtps.com/2009/08/missing-ruby-headers-after-snow-leopard-upgrade