TDD新手并尝试使用新应用设置环境。我创建了一个新的rails app和bundle安装了以下内容:
group :test, :development do
gem 'turn'
gem 'rspec-rails'
gem 'capybara'
gem 'guard-rspec'
gem 'growl_notify'
end
在做了一个rspec:install和guard init后,我尝试运行“guard”但得到了(-10660)(Connect :: CantLaunchApplicationError)。以下是控制台输出:
/Users/Username/.rvm/gems/ruby-1.9.3-p194/gems/rb-appscript-0.6.1/lib/_aem/connect.rb:89:in `rescue in launch_application': The application cannot be run because it is inside a Trash folder. (-10660) (Connect::CantLaunchApplicationError)
from /Users/Username/.rvm/gems/ruby-1.9.3-p194/gems/rb-appscript-0.6.1/lib/_aem/connect.rb:85:in `launch_application'
from /Users/Username/.rvm/gems/ruby-1.9.3-p194/gems/rb-appscript-0.6.1/lib/_aem/connect.rb:182:in `rescue in local_app'
from /Users/Username/.rvm/gems/ruby-1.9.3-p194/gems/rb-appscript-0.6.1/lib/_aem/connect.rb:177:in `local_app'
from /Users/Username/.rvm/gems/ruby-1.9.3-p194/gems/rb-appscript-0.6.1/lib/aem.rb:146:in `by_path'
from /Users/Username/.rvm/gems/ruby-1.9.3-p194/gems/rb-appscript-0.6.1/lib/appscript.rb:57:in `connect'
from /Users/Username/.rvm/gems/ruby-1.9.3-p194/gems/rb-appscript-0.6.1/lib/appscript.rb:159:in `reference_by_name'
from /Users/Username/.rvm/gems/ruby-1.9.3-p194/gems/rb-appscript-0.6.1/lib/appscript.rb:633:in `method_missing'
from /Users/Username/.rvm/gems/ruby-1.9.3-p194/gems/growl_notify-0.0.3/lib/growl_notify.rb:29:in `register'
from /Users/Username/.rvm/gems/ruby-1.9.3-p194/gems/growl_notify-0.0.3/lib/growl_notify.rb:19:in `config'
from /Users/Username/.rvm/gems/ruby-1.9.3-p194/gems/guard-1.8.0/lib/guard/notifiers/growl_notify.rb:44:in `available?'
from /Users/Username/.rvm/gems/ruby-1.9.3-p194/gems/guard-1.8.0/lib/guard/notifier.rb:158:in `add_notification'
from /Users/Username/.rvm/gems/ruby-1.9.3-p194/gems/guard-1.8.0/lib/guard/notifier.rb:209:in `block (2 levels) in auto_detect_notification'
from /Users/Username/.rvm/gems/ruby-1.9.3-p194/gems/guard-1.8.0/lib/guard/notifier.rb:209:in `each'
from /Users/Username/.rvm/gems/ruby-1.9.3-p194/gems/guard-1.8.0/lib/guard/notifier.rb:209:in `find'
from /Users/Username/.rvm/gems/ruby-1.9.3-p194/gems/guard-1.8.0/lib/guard/notifier.rb:209:in `block in auto_detect_notification'
from /Users/Username/.rvm/gems/ruby-1.9.3-p194/gems/guard-1.8.0/lib/guard/notifier.rb:208:in `each'
from /Users/Username/.rvm/gems/ruby-1.9.3-p194/gems/guard-1.8.0/lib/guard/notifier.rb:208:in `auto_detect_notification'
from /Users/Username/.rvm/gems/ruby-1.9.3-p194/gems/guard-1.8.0/lib/guard/notifier.rb:101:in `turn_on'
from /Users/Username/.rvm/gems/ruby-1.9.3-p194/gems/guard-1.8.0/lib/guard.rb:159:in `setup_notifier'
from /Users/Username/.rvm/gems/ruby-1.9.3-p194/gems/guard-1.8.0/lib/guard.rb:68:in `setup'
from /Users/Username/.rvm/gems/ruby-1.9.3-p194/gems/guard-1.8.0/lib/guard.rb:188:in `start'
from /Users/Username/.rvm/gems/ruby-1.9.3-p194/gems/guard-1.8.0/lib/guard/cli.rb:110:in `start'
from /Users/Username/.rvm/gems/ruby-1.9.3-p194/gems/thor-0.18.1/lib/thor/command.rb:27:in `run'
from /Users/Username/.rvm/gems/ruby-1.9.3-p194/gems/thor-0.18.1/lib/thor/invocation.rb:120:in `invoke_command'
from /Users/Username/.rvm/gems/ruby-1.9.3-p194/gems/thor-0.18.1/lib/thor.rb:363:in `dispatch'
from /Users/Username/.rvm/gems/ruby-1.9.3-p194/gems/thor-0.18.1/lib/thor/base.rb:439:in `start'
from /Users/Username/.rvm/gems/ruby-1.9.3-p194/gems/guard-1.8.0/bin/guard:6:in `<top (required)>'
from /Users/Username/.rvm/gems/ruby-1.9.3-p194/bin/guard:23:in `load'
from /Users/Username/.rvm/gems/ruby-1.9.3-p194/bin/guard:23:in `<main>'
from /Users/Username/.rvm/gems/ruby-1.9.3-p194/bin/ruby_noexec_wrapper:14:in `eval'
from /Users/Username/.rvm/gems/ruby-1.9.3-p194/bin/ruby_noexec_wrapper:14:in `<main>'
答案 0 :(得分:2)
growl_notify 似乎是一个问题。
Guard正在使用的代码路径涉及在OS X上使用LaunchServices,这要求运行的应用程序不在“废纸篓”中。尝试启动垃圾箱中的应用时会抛出错误kLSAppInTrashErr = -10660
。
在这种情况下,请在回溯中查看此行:
from /Users/Username/.rvm/gems/ruby-1.9.3-p194/gems/growl_notify-0.0.3/lib/growl_notify.rb:29:in `register'
看起来它正在尝试使用Growl(请参阅代码here)。我会检查你的垃圾桶是否完全是空的,如果你打算使用growl_notify,请确保正确安装Growl或者禁用它。