【问题标题】:Error while installing rb-appscript gem安装 rb-appscript gem 时出错
【发布时间】:2012-03-28 11:44:55
【问题描述】:

我想使用测试驱动开发 (TDD) 创建一个 Rails 应用程序,所以我写了

rails new myproject -T

然后我在 gemfile 中添加了这些代码行

group :test, :development do
    gem 'turn'
    gem 'rspec-rails'
    gem 'capybara'
    gem 'guard-rspec'
    gem 'growl_notify'
end 

所以我尝试安装捆绑包,但捆绑时出现此错误

Installing rb-appscript (0.6.1) with native extensions 
Gem::Installer::ExtensionBuildError: ERROR: Failed to build gem native extension.

        /usr/share/ruby-rvm/rubies/ruby-1.9.3-p125/bin/ruby extconf.rb 
extconf.rb:44: Use RbConfig instead of obsolete and deprecated Config.
create /var/lib/ruby-rvm/gems/ruby-1.9.3-p125/gems/rb-appscript-0.6.1/src/osx_ruby.h ...
create /var/lib/ruby-rvm/gems/ruby-1.9.3-p125/gems/rb-appscript-0.6.1/src/osx_intern.h ...
creating Makefile

make
Makefile:226: warning: overriding commands for target `/usr/share/ruby-rvm/gems/ruby-1.9.3-p125/gems/rb-appscript-0.6.1/lib'
Makefile:224: warning: ignoring old commands for target `/usr/share/ruby-rvm/gems/ruby-1.9.3-p125/gems/rb-appscript-0.6.1/lib'
compiling src/rbae.c
src/rbae.c:13:27: fatal error: Carbon/Carbon.h: No such file or directory
compilation terminated.
make: *** [rbae.o] Error 1


Gem files will remain installed in /usr/share/ruby-rvm/gems/ruby-1.9.3-p125/gems/rb-appscript-0.6.1 for inspection.
Results logged to /usr/share/ruby-rvm/gems/ruby-1.9.3-p125/gems/rb-appscript-0.6.1/./gem_make.out
An error occured while installing rb-appscript (0.6.1), and Bundler cannot continue.
Make sure that `gem install rb-appscript -v '0.6.1'` succeeds before bundling.

所以我尝试手动安装 gem

gem install rb-appscript -v '0.6.1'

我也遇到了类似的错误

Building native extensions.  This could take a while...
ERROR:  Error installing rb-appscript:
    ERROR: Failed to build gem native extension.

        /usr/share/ruby-rvm/rubies/ruby-1.9.3-p125/bin/ruby extconf.rb
extconf.rb:44: Use RbConfig instead of obsolete and deprecated Config.
create /var/lib/ruby-rvm/gems/ruby-1.9.3-p125/gems/rb-appscript-0.6.1/src/osx_ruby.h ...
create /var/lib/ruby-rvm/gems/ruby-1.9.3-p125/gems/rb-appscript-0.6.1/src/osx_intern.h ...
creating Makefile

make
Makefile:226: warning: overriding commands for target `/usr/share/ruby-rvm/gems/ruby-1.9.3-p125/gems/rb-appscript-0.6.1/lib'
Makefile:224: warning: ignoring old commands for target `/usr/share/ruby-rvm/gems/ruby-1.9.3-p125/gems/rb-appscript-0.6.1/lib'
compiling src/rbae.c
src/rbae.c:13:27: fatal error: Carbon/Carbon.h: No such file or directory
compilation terminated.
make: *** [rbae.o] Error 1

Gem files will remain installed in /usr/share/ruby-rvm/gems/ruby-1.9.3-p125/gems/rb-appscript-0.6.1 for inspection.
Results logged to /usr/share/ruby-rvm/gems/ruby-1.9.3-p125/gems/rb-appscript-0.6.1/./gem_make.out

所以有什么建议我现在可以做什么?

【问题讨论】:

  • 您使用的是什么操作系统版本?
  • 同样来自 rb-appscript 的网站:“请注意 appscript 不再被开发或支持,不建议在新项目中使用它。”

标签: rubygems rb-appscript


【解决方案1】:

Growl 仅适用于 Mac OS X,而不是您可能想要的 growl_notify

gem 'libnotify'

Guard readme 中了解更多信息。

【讨论】:

  • 不过,我在 Mac OS X Yosemite 上遇到了同样的问题。
猜你喜欢
  • 2012-01-23
  • 2015-10-08
  • 2023-03-09
  • 2011-08-03
  • 2015-12-27
  • 2014-01-16
  • 2013-03-09
  • 2011-09-11
相关资源
最近更新 更多