2013-03-03 1 views
1

Guard가 jruby에서 작동하지 못하게합니다. 나는 rvm을 통해 1.9.3 옆에 jruby가 inistalled했다. 1.9.3에서 가드를 실행하려고 - 잘 작동합니다. spec 또는 lib의 모든 변경 사항에 대해 자동으로 사양을 실행하게하려면 어떻게해야합니까? 이것은 내가 bundle exec guard를 실행 한 후없이 파일을 얻을 것입니다Guard (rspec)가 jruby에서 작동하지 않는 이유

여기 Enter 키를 누릅니다하는 한편

[email protected]:/vagrant/sample$ bundle exec guard 
21:16:46 - INFO - Guard uses TerminalTitle to send notifications. 
21:16:47 - INFO - Guard::RSpec is running 
21:16:47 - INFO - Running all specs 
... 

Finished in 0.025 seconds 
3 examples, 0 failures 

21:17:20 - INFO - Guard is now watching at '/vagrant/sample' 
before_session hook failed: Errno::ENOENT: No such file or directory - /vagrant/sample 
org/jruby/RubyFile.java:333:in `initialize' 
(see _pry_.hooks.errors to debug) 
[1] guard(main)> 

그리고 SPEC 다시 실행 할 수있는 유일한 방법 변경. 또한이 No such file or directory 일의 출처를 확인할 수 없습니다 (1.9.3 MRI에서는 팝업되지 않습니다). 나는 내부 구조에 익숙하지 않아서 왜 그런 일이 일어나는지 알 수 없다. 내 Guardfile

표준 하나입니다

guard 'rspec' do   
    watch(%r{^spec/.+_spec\.rb$}) 
    watch(%r{^lib/(.+)\.rb$})  { |m| "spec/#{m[1]}_spec.rb" } 
    watch('spec/spec_helper.rb') { "spec" } 
end 

Gemfile 만 포함

gem 'rspec', '~>2.13.0' 
gem 'guard-rspec' 
gem 'rb-inotify', '~>0.9' 

답변

2

before_session 후크 Pry에서,하지만 가드는 후크의이 유형을 사용하지 않습니다 (우리는 단지 사용 : when_started 및 : after_eval) :

[1] guard(main)> Pry.hooks 
=> #<Pry::Hooks:0x007ff0359a36c0 
@errors=[], 
@hooks= 
    {:before_session=> 
    [[:default, 
     #<Proc:[email protected]/Users/michi/.rbenv/versions/1.9.3-p327/lib/ruby/gems/1.9.1/gems/pry-0.9.12/lib/pry.rb:11>]], 
    :when_started=> 
    [[:load_guard_rc, 
     #<Proc:[email protected]/Users/michi/.rbenv/versions/1.9.3-p327/lib/ruby/gems/1.9.1/gems/guard-1.6.2/lib/guard/interactor.rb:109>]], 
    :after_eval=> 
    [[:restore_visibility, 
     #<Proc:[email protected]/Users/michi/.rbenv/versions/1.9.3-p327/lib/ruby/gems/1.9.1/gems/guard-1.6.2/lib/guard/interactor.rb:116>]], 
    :after_session=>[], 
    :after_read=>[], 
    :before_eval=>[]}> 

나는 Pry 버그를 제출하고 인터랙 터없이 Guard를 실행합니다 (guard -i).

0

하면 Guardfile

# disable Pry for continious integration 
interactor :off 
에 추가