Ruby OSA gem安装问题

时间:2010-01-12 20:47:20

标签: ruby rubygems rubyosa

尝试在我的iMac上安装rubyOSA

sudo gem install rubyosa

我收到以下错误:

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

2 个答案:

答案 0 :(得分:2)

我在安装宝石时出现过很多次错误。后来我发现我需要包含编译所需的所有头文件的开发包。在debian机器上,他们使用ruby-dev软件包。

我在互联网上读到OS X通过XCode发送标题,所以你可能需要从那里获取它们。

我发现此链接可能对您有所帮助: http://www.fngtps.com/2009/08/missing-ruby-headers-after-snow-leopard-upgrade [编辑:原始链接已损坏,这是该页面的互联网存档: https://web.archive.org/web/20100327201647/http://www.fngtps.com/2009/08/missing-ruby-headers-after-snow-leopard-upgrade

答案 1 :(得分:0)

我刚发现这个GitHub project允许在Snow Leopard上进行编译和安装。它安装得很干净,我能够在irb中快速检查“require'rbosa'”:

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>