當我跑衛初始化我得到一個錯誤利用後衛的後衛/ PHPUnit的插件
app>guard init
14:56:14 - ERROR - Could not load 'guard/phpunit' or '~/.guard/templates/phpunit
' or find class Guard::Phpunit
創建保護文件,但其空。它應該包含這些代碼
guard 'phpunit', :cli => 'colors' do
watch(%r{^.+Test.php$})
end
但是當我編輯該文件手動包括它和跑衛,我得到
app>guard
14:59:32 - ERROR - Could not load 'guard/phpunit' or find class Guard::Phpunit
14:59:32 - ERROR - C:/Ruby193/lib/ruby/site_ruby/1.9.1/rubygems/specification.rb
:1637:in `raise_if_conflicts'
> [#] C:/Ruby193/lib/ruby/site_ruby/1.9.1/rubygems/specification.rb:746:in `acti
vate'
> [#] C:/Ruby193/lib/ruby/site_ruby/1.9.1/rubygems.rb:212:in `rescue in try_acti
vate'
> [#] C:/Ruby193/lib/ruby/site_ruby/1.9.1/rubygems.rb:209:in `try_activate'
> [#] C:/Ruby193/lib/ruby/site_ruby/1.9.1/rubygems/custom_require.rb:59:in `resc
ue in require'
> [#] C:/Ruby193/lib/ruby/site_ruby/1.9.1/rubygems/custom_require.rb:35:in `requ
ire'
> [#] C:/Ruby193/lib/ruby/gems/1.9.1/gems/guard-2.2.4/lib/guard/plugin_util.rb:1
00:in `plugin_class'
> [#] C:/Ruby193/lib/ruby/gems/1.9.1/gems/guard-2.2.4/lib/guard/plugin_util.rb:5
7:in `initialize_plugin'
> [#] C:/Ruby193/lib/ruby/gems/1.9.1/gems/guard-2.2.4/lib/guard.rb:167:in `add_p
lugin'
> [#] C:/Ruby193/lib/ruby/gems/1.9.1/gems/guard-2.2.4/lib/guard/dsl.rb:175:in `b
lock in guard'
> [#] C:/Ruby193/lib/ruby/gems/1.9.1/gems/guard-2.2.4/lib/guard/dsl.rb:173:in `e
ach'
> [#] C:/Ruby193/lib/ruby/gems/1.9.1/gems/guard-2.2.4/lib/guard/dsl.rb:173:in `g
uard'
> [#] C:/Users/Mark/Dropbox/www/trainercompare/app/Guardfile:4:in `_instance_eva
l_guardfile'
> [#] C:/Ruby193/lib/ruby/gems/1.9.1/gems/guard-2.2.4/lib/guard/guardfile/evalua
tor.rb:121:in `instance_eval'
> [#] C:/Ruby193/lib/ruby/gems/1.9.1/gems/guard-2.2.4/lib/guard/guardfile/evalua
tor.rb:121:in `_instance_eval_guardfile'
> [#] C:/Ruby193/lib/ruby/gems/1.9.1/gems/guard-2.2.4/lib/guard/guardfile/evalua
tor.rb:37:in `evaluate_guardfile'
> [#] C:/Ruby193/lib/ruby/gems/1.9.1/gems/guard-2.2.4/lib/guard/setuper.rb:144:i
n `evaluate_guardfile'
> [#] C:/Ruby193/lib/ruby/gems/1.9.1/gems/guard-2.2.4/lib/guard/setuper.rb:62:in
`setup'
> [#] C:/Ruby193/lib/ruby/gems/1.9.1/gems/guard-2.2.4/lib/guard/commander.rb:24:
in `start'
> [#] C:/Ruby193/lib/ruby/gems/1.9.1/gems/guard-2.2.4/lib/guard/cli.rb:96:in `st
art'
> [#] C:/Ruby193/lib/ruby/gems/1.9.1/gems/thor-0.18.1/lib/thor/command.rb:27:in
`run'
> [#] C:/Ruby193/lib/ruby/gems/1.9.1/gems/thor-0.18.1/lib/thor/invocation.rb:120
:in `invoke_command'
> [#] C:/Ruby193/lib/ruby/gems/1.9.1/gems/thor-0.18.1/lib/thor.rb:363:in `dispat
ch'
> [#] C:/Ruby193/lib/ruby/gems/1.9.1/gems/thor-0.18.1/lib/thor/base.rb:439:in `s
tart'
> [#] C:/Ruby193/lib/ruby/gems/1.9.1/gems/guard-2.2.4/bin/guard:6:in `<top (requ
ired)>'
> [#] C:/Ruby193/bin/guard:23:in `load'
> [#] C:/Ruby193/bin/guard:23:in `<main>'
14:59:32 - ERROR - Invalid Guardfile, original error is:
> [#] undefined method `superclass' for nil:NilClass
C:/Ruby193/lib/ruby/gems/1.9.1/gems/guard-2.2.4/lib/guard/plugin_util.rb:57:in `
initialize_plugin': undefined method `superclass' for nil:NilClass (NoMethodErro
r)
from C:/Ruby193/lib/ruby/gems/1.9.1/gems/guard-2.2.4/lib/guard.rb:167:in
`add_plugin'
from C:/Ruby193/lib/ruby/gems/1.9.1/gems/guard-2.2.4/lib/guard/dsl.rb:17
5:in `block in guard'
from C:/Ruby193/lib/ruby/gems/1.9.1/gems/guard-2.2.4/lib/guard/dsl.rb:17
3:in `each'
from C:/Ruby193/lib/ruby/gems/1.9.1/gems/guard-2.2.4/lib/guard/dsl.rb:17
3:in `guard'
from C:/Users/Mark/Dropbox/www/trainercompare/app/Guardfile:4:in `_insta
nce_eval_guardfile'
from C:/Ruby193/lib/ruby/gems/1.9.1/gems/guard-2.2.4/lib/guard/guardfile
/evaluator.rb:121:in `instance_eval'
from C:/Ruby193/lib/ruby/gems/1.9.1/gems/guard-2.2.4/lib/guard/guardfile
/evaluator.rb:121:in `_instance_eval_guardfile'
from C:/Ruby193/lib/ruby/gems/1.9.1/gems/guard-2.2.4/lib/guard/guardfile
/evaluator.rb:37:in `evaluate_guardfile'
from C:/Ruby193/lib/ruby/gems/1.9.1/gems/guard-2.2.4/lib/guard/setuper.r
b:144:in `evaluate_guardfile'
from C:/Ruby193/lib/ruby/gems/1.9.1/gems/guard-2.2.4/lib/guard/setuper.r
b:62:in `setup'
from C:/Ruby193/lib/ruby/gems/1.9.1/gems/guard-2.2.4/lib/guard/commander
.rb:24:in `start'
from C:/Ruby193/lib/ruby/gems/1.9.1/gems/guard-2.2.4/lib/guard/cli.rb:96
:in `start'
from C:/Ruby193/lib/ruby/gems/1.9.1/gems/thor-0.18.1/lib/thor/command.rb
:27:in `run'
from C:/Ruby193/lib/ruby/gems/1.9.1/gems/thor-0.18.1/lib/thor/invocation
.rb:120:in `invoke_command'
from C:/Ruby193/lib/ruby/gems/1.9.1/gems/thor-0.18.1/lib/thor.rb:363:in
`dispatch'
from C:/Ruby193/lib/ruby/gems/1.9.1/gems/thor-0.18.1/lib/thor/base.rb:43
9:in `start'
from C:/Ruby193/lib/ruby/gems/1.9.1/gems/guard-2.2.4/bin/guard:6:in `<to
p (required)>'
from C:/Ruby193/bin/guard:23:in `load'
from C:/Ruby193/bin/guard:23:in `<main>'
我認爲問題是,後衛/ PHPUnit的是一個廢棄的項目,也沒有已經更新以支持最新的後衛。我想,這是因爲當我刪除所有與防範2.2.4,並留下與守衛1.8.3後衛將運行,看文件,一旦運行PHPUnit的唯一文件的寶石文件(失敗,它不應該),然後拒絕繼續看着它不完全工作,但更進一步。
- 任何人都可以給我一個修復嗎?
- 我不是一個rubyist但在後衛的代碼/ PHPUnit的看起來很簡單,任何人都可以給我的地方一個鏈接,介紹瞭如何去確保一個插件是後衛2.2.4兼容嗎?我可以自己試試
- 其他想法?
我不是一個rubyist但在後衛的代碼/ PHPUnit的看起來很簡單,我很迷惘
謝謝你,我只是簽出並安裝護phpunit2和我得到了同樣的錯誤,所以我想這排除了爲事業我將不得不看看週末如何設置一切,當我有時間嘗試尋找原因時,因爲我已經燒壞了每次保存切換到cmd行:p – Ir1sh
我剛碰到這個問題早上和'guard-phpunit2'是修復。您還需要更改'Guardfile'以反映從'phpunit'到'phpunit2'的更改。像魅力一樣工作。 –