2011-12-26 22 views
8

Tôi đã chạy Guard cho RSPEC và sử dụng gem growl_notify trong một thời gian (2-3 tháng), nhưng bây giờ tôi không thể nhận được guard để chạy trong bất kỳ dự án Rails 3.1.1 nào của tôi. Tôi đã thực hiện một số nghiên cứu về lỗi chính nó, nhưng không thể đưa ra bất cứ điều gì kết luận (ngoại trừ someone else có cùng một vấn đề).Rails 3.1.1 Guard-rspec không thể chạy do lỗi Growl: OSERROR: -10000 THÔNG ĐIỆP: Trình xử lý sự kiện của Apple không thành công

Gemfile:

source 'http://rubygems.org' 

gem 'rails', '3.1.1' 

# Bundle edge Rails instead: 
# gem 'rails',  :git => 'git://github.com/rails/rails.git' 

# Gems used only for assets and not required 
# in production environments by default. 
group :assets do 
    gem 'sass-rails', '~> 3.1.4' 
    gem 'coffee-rails', '~> 3.1.1' 
    gem 'uglifier', '>= 1.0.3' 
end 

gem 'jquery-rails' 
gem 'spreadsheet' # Allows for reading/writing Excel files. We also need a CSV importer, but that can come later 
gem 'gmaps4rails' # Allows for Google Maps Pushpins/Markers/Places 
gem 'scoped_search' # For Searching 
gem "paperclip", :git => "git://github.com/thoughtbot/paperclip.git" # For File Uploads 

group :test, :development do 
    gem 'sqlite3' 
    gem 'turn', '<0.8.3' 
    gem 'rspec-rails' 
    gem 'capybara' 
    gem 'guard-rspec' 
    gem 'growl_notify' 
    gem 'launchy' 
    gem 'capistrano' #You don't want Capistrano on the production side (I think) 
end 

group :production do 
    gem 'pg' #use postgres for database installation as the database 
end 

Lỗi:

[email protected]:~/development/rails/tasks$ guard 
/Users/Thomas/.rvm/gems/ruby-1.9.2-p290/gems/rb-appscript-0.6.1/lib/appscript.rb:542:in `_send_command': CommandError (Appscript::CommandError) 
     OSERROR: -10000 
     MESSAGE: Apple event handler failed. 
     COMMAND: app("/Library/PreferencePanes/Growl.prefPane/Contents/Resources/GrowlHelperApp.app").register({:all_notifications=>["success", "pending", "failed", "notify"], :as_application=>"Guard", :default_notifications=>"notify"}) 
    from /Users/Thomas/.rvm/gems/ruby-1.9.2-p290/gems/rb-appscript-0.6.1/lib/appscript.rb:642:in `method_missing' 
    from /Users/Thomas/.rvm/gems/ruby-1.9.2-p290/gems/growl_notify-0.0.3/lib/growl_notify.rb:29:in `register' 
    from /Users/Thomas/.rvm/gems/ruby-1.9.2-p290/gems/growl_notify-0.0.3/lib/growl_notify.rb:19:in `config' 
    from /Users/Thomas/.rvm/gems/ruby-1.9.2-p290/gems/guard-0.9.4/lib/guard/notifiers/growl_notify.rb:42:in `available?' 
from /Users/Thomas/.rvm/gems/ruby-1.9.2-p290/gems/guard- 0.9.4/lib/guard/notifier.rb:117:in `add_notification' 
    from /Users/Thomas/.rvm/gems/ruby-1.9.2-p290/gems/guard-0.9.4/lib/guard/notifier.rb:154:in `block in auto_detect_notification' 
    from /Users/Thomas/.rvm/gems/ruby-1.9.2-p290/gems/guard-0.9.4/lib/guard/notifier.rb:154:in `each' 
    from /Users/Thomas/.rvm/gems/ruby-1.9.2-p290/gems/guard-0.9.4/lib/guard/notifier.rb:154:in `any?' 
    from /Users/Thomas/.rvm/gems/ruby-1.9.2-p290/gems/guard-0.9.4/lib/guard/notifier.rb:154:in `auto_detect_notification' 
from /Users/Thomas/.rvm/gems/ruby-1.9.2-p290/gems/guard- 0.9.4/lib/guard/notifier.rb:80:in `turn_on' 
    from /Users/Thomas/.rvm/gems/ruby-1.9.2-p290/gems/guard-0.9.4/lib/guard.rb:184:in `start' 
    from /Users/Thomas/.rvm/gems/ruby-1.9.2-p290/gems/guard-0.9.4/lib/guard/cli.rb:74:in `start' 
    from /Users/Thomas/.rvm/gems/ruby-1.9.2-p290/gems/thor-0.14.6/lib/thor/task.rb:22:in `run' 
from /Users/Thomas/.rvm/gems/ruby-1.9.2-p290/gems/thor- 0.14.6/lib/thor/invocation.rb:118:in `invoke_task' 
from /Users/Thomas/.rvm/gems/ruby-1.9.2-p290/gems/thor- 0.14.6/lib/thor.rb:263:in `dispatch' 
    from /Users/Thomas/.rvm/gems/ruby-1.9.2-p290/gems/thor-0.14.6/lib/thor/base.rb:389:in `start' 
    from /Users/Thomas/.rvm/gems/ruby-1.9.2-p290/gems/guard-0.9.4/bin/guard:6:in `<top (required)>' 
    from /Users/Thomas/.rvm/gems/ruby-1.9.2-p290/bin/guard:19:in `load' 
    from /Users/Thomas/.rvm/gems/ruby-1.9.2-p290/bin/guard:19:in `<main>' 
+0

tôi chỉ gặp vấn đề tương tự – keruilin

Trả lời

5

này dường như là một phiên bản không phù hợp giữa Growl và growl_notify. growl_notify 0.0.3 thay đổi tên ứng dụng Growl, mà gần như tôi có thể nói thay đổi với Growl 1.3 (Lion chỉ)

Tôi tin rằng nó hoạt động ra:

  • sử dụng growl_notify 0.0.2 cho Growl < 1.3
  • sử dụng growl_notify 0.0.3 cho Growl> = 1,3
  • sử dụng tiếng gầm đá quý (những gì tôi đã làm)
+0

Đừng quên gỡ cài đặt các đá quý khác (ví dụ: xóa growl_notify nếu bạn đang sử dụng gem ngọc lục bảo). – Lenart

7

đây là những gì làm việc cho tôi. Hai điều:

Đầu tiên, Guard 0.10.x. yêu cầu Growl> = 1.3. Cài đặt Growl 1.3 từ App Store (đánh giá thew thực sự tồi tệ, nhưng tôi không gặp khó khăn gì).

Thứ hai, các phiên bản bảo vệ mới đề xuất ruby_gntp. Chỉ cần thay thế gem 'growl_notify' bằng gem 'ruby_gntp'.

+0

Đi đá quý 'ruby_gntp' nếu bạn đang trên báo tuyết –