我無法讓Guard在jruby上工作。我通過1.9.3旁邊的rvm進行了jruby的檢查。試圖在1.9.3上運行Guard - 工作正常。如何在spec
或lib
的每次更改中自動運行規格?爲什麼Guard(rspec)在jruby上停止工作
這是我跑bundle exec guard
後沒有拿到的文件在此期間
[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)>
並再次運行規範的唯一途徑改變是按ENTER鍵在這裏。此外,我無法確定這個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'