Warning: file_get_contents(/data/phpspider/zhask/data//catemap/5/ruby/22.json): failed to open stream: No such file or directory in /data/phpspider/zhask/libs/function.php on line 167

Warning: Invalid argument supplied for foreach() in /data/phpspider/zhask/libs/tag.function.php on line 1116

Notice: Undefined index: in /data/phpspider/zhask/libs/function.php on line 180

Warning: array_chunk() expects parameter 1 to be array, null given in /data/phpspider/zhask/libs/function.php on line 181
为什么Guard(rspec)停止在jruby上工作_Ruby_Rspec_Jruby_Guard_Specifications - Fatal编程技术网

为什么Guard(rspec)停止在jruby上工作

为什么Guard(rspec)停止在jruby上工作,ruby,rspec,jruby,guard,specifications,Ruby,Rspec,Jruby,Guard,Specifications,我无法让警卫在jruby上工作。我已经通过rvm在1.9.3旁边安装了jruby。尝试在1.9.3上运行守卫-工作正常。如何使它在spec或lib中的每次更改时自动运行spec 这是我在运行bundle exec-guard后得到的,同时没有更改任何文件 vagrant@precise64:/vagrant/sample$ bundle exec guard 21:16:46 - INFO - Guard uses TerminalTitle to send notifications. 21:

我无法让警卫在jruby上工作。我已经通过rvm在1.9.3旁边安装了jruby。尝试在1.9.3上运行守卫-工作正常。如何使它在
spec
lib
中的每次更改时自动运行spec

这是我在运行
bundle exec-guard
后得到的,同时没有更改任何文件

vagrant@precise64:/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的唯一方法是在这里按ENTER键。此外,我也无法确定这个
没有这样的文件或目录的来源(它不会在1.9.3MRI上弹出)。我不熟悉警卫的内部结构,也不知道为什么会发生这种情况

我的
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'

before\u会话
hook来自,但Guard不使用这种类型的hook(我们仅使用:启动时和评估后):

[1]防护罩(主)>撬钩
=> #
[:默认值,
#]],
:当_开始时=>
[[:装载防护装置,
#]],
:评估后=>
[:恢复可视性,
#]],
:在会话=>[]之后,
:在读取=>[]之后,
:在评估之前=>[]}>

我会提交一个Pry bug并在没有Interactior的情况下运行Guard(
Guard-I
),直到修复为止。

将它添加到您的Guardfile中

# disable Pry for continious integration
interactor :off
# disable Pry for continious integration
interactor :off