views:

303

answers:

3

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
+1  A: 

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

pgmura
The "Missing ruby headers after snow leopard upgrade" link was it. Thanks.
tybro0103
A: 

I just found this GitHub project that allows compiling and installation on Snow Leopard. It installed cleanly for me and I was able to check a quick "require 'rbosa'" in irb:

irb(main):001:0> require 'rbosa'
=> true
irb(main):002:0> app = OSA.app('iTunes')
=> <OSA::ITunes::Application:0x102aae648 desc="'sign'($6B6F6F68$)">
irb(main):003:0> puts app.current_track.name
The Pipeline 3: Jason Fried
=> nil
irb(main):004:0> 
Nathan L. Walls
A: 

Worked for me on Snow Leopard by installing the pbosetti-rubyosa gem, checkout http://github.com/pbosetti/rubyosa

Ahmed El Gamil