Errno :: EPERM:不允许操作@ unlink_internal - tmp / rspec_guard_result

时间:2016-04-29 08:07:41

标签: guard tmp

ENV

ruby 2.3.0p0 (2015-12-25 revision 53290) [x86_64-linux]

Rails 4.2.0

Guard version 2.13.0

问题:

我认为这不是因为规范本身,因为它在键入bundle exec rspec xxx_spec.rb时正常工作

我在运行此命令之前意外运行rm -rf /tmp,我认为这是tmp/rspec_guard_result中出错的原因。但不知道如何解决它。

运行所有规格后,它会显示以下结果:

结果

Finished in 1 minute 15.84 seconds (files took 0.46012 seconds to load)
177 examples, 1 failure, 3 pending

Failed examples:

rspec ./spec/models/xxxxxx_spec.rb:88 # xxxx valid should xxxxxx
07:36:42 - ERROR - Guard::RSpec failed to achieve its <run_all>, exception was:
> [#a47cf0a740cd] Errno::EPERM: Operation not permitted @ unlink_internal - tmp/rspec_guard_result
> [#a47cf0a740cd] /home/vagrant/.rbenv/versions/2.3.0/lib/ruby/gems/2.3.0/gems/guard-rspec-4.5.0/lib/guard/rspec/runner.rb:79:in `delete'
> [#a47cf0a740cd] /home/vagrant/.rbenv/versions/2.3.0/lib/ruby/gems/2.3.0/gems/guard-rspec-4.5.0/lib/guard/rspec/runner.rb:79:in `_command_output'
> [#a47cf0a740cd] /home/vagrant/.rbenv/versions/2.3.0/lib/ruby/gems/2.3.0/gems/guard-rspec-4.5.0/lib/guard/rspec/runner.rb:100:in `_process_run_result'
> [#a47cf0a740cd] /home/vagrant/.rbenv/versions/2.3.0/lib/ruby/gems/2.3.0/gems/guard-rspec-4.5.0/lib/guard/rspec/runner.rb:45:in `block in _run'
> [#a47cf0a740cd] /home/vagrant/.rbenv/versions/2.3.0/lib/ruby/gems/2.3.0/gems/guard-rspec-4.5.0/lib/guard/rspec/runner.rb:44:in `tap'
> [#a47cf0a740cd] /home/vagrant/.rbenv/versions/2.3.0/lib/ruby/gems/2.3.0/gems/guard-rspec-4.5.0/lib/guard/rspec/runner.rb:44:in `_run'
> [#a47cf0a740cd] /home/vagrant/.rbenv/versions/2.3.0/lib/ruby/gems/2.3.0/gems/guard-rspec-4.5.0/lib/guard/rspec/runner.rb:24:in `run_all'
> [#a47cf0a740cd] /home/vagrant/.rbenv/versions/2.3.0/lib/ruby/gems/2.3.0/gems/guard-rspec-4.5.0/lib/guard/rspec.rb:33:in `block in run_all'
> [#a47cf0a740cd] /home/vagrant/.rbenv/versions/2.3.0/lib/ruby/gems/2.3.0/gems/guard-rspec-4.5.0/lib/guard/rspec.rb:48:in `_throw_if_failed'
> [#a47cf0a740cd] /home/vagrant/.rbenv/versions/2.3.0/lib/ruby/gems/2.3.0/gems/guard-rspec-4.5.0/lib/guard/rspec.rb:33:in `run_all'
> [#a47cf0a740cd] /home/vagrant/.rbenv/versions/2.3.0/lib/ruby/gems/2.3.0/gems/guard-2.13.0/lib/guard/runner.rb:82:in `block in _supervise'
> [#a47cf0a740cd] /home/vagrant/.rbenv/versions/2.3.0/lib/ruby/gems/2.3.0/gems/guard-2.13.0/lib/guard/runner.rb:79:in `catch'
> [#a47cf0a740cd] /home/vagrant/.rbenv/versions/2.3.0/lib/ruby/gems/2.3.0/gems/guard-2.13.0/lib/guard/runner.rb:79:in `_supervise'
> [#a47cf0a740cd] /home/vagrant/.rbenv/versions/2.3.0/lib/ruby/gems/2.3.0/gems/guard-2.13.0/lib/guard/runner.rb:22:in `block (3 levels) in run'
> [#a47cf0a740cd] /home/vagrant/.rbenv/versions/2.3.0/lib/ruby/gems/2.3.0/gems/guard-2.13.0/lib/guard/runner.rb:119:in `block (2 levels) in _run_group_plugins'
> [#a47cf0a740cd] /home/vagrant/.rbenv/versions/2.3.0/lib/ruby/gems/2.3.0/gems/guard-2.13.0/lib/guard/runner.rb:117:in `each'
> [#a47cf0a740cd] /home/vagrant/.rbenv/versions/2.3.0/lib/ruby/gems/2.3.0/gems/guard-2.13.0/lib/guard/runner.rb:117:in `block in _run_group_plugins'
> [#a47cf0a740cd] /home/vagrant/.rbenv/versions/2.3.0/lib/ruby/gems/2.3.0/gems/guard-2.13.0/lib/guard/runner.rb:116:in `catch'
> [#a47cf0a740cd] /home/vagrant/.rbenv/versions/2.3.0/lib/ruby/gems/2.3.0/gems/guard-2.13.0/lib/guard/runner.rb:116:in `_run_group_plugins'
> [#a47cf0a740cd] /home/vagrant/.rbenv/versions/2.3.0/lib/ruby/gems/2.3.0/gems/guard-2.13.0/lib/guard/runner.rb:21:in `block (2 levels) in run'
> [#a47cf0a740cd] /home/vagrant/.rbenv/versions/2.3.0/lib/ruby/gems/2.3.0/gems/guard-2.13.0/lib/guard/runner.rb:20:in `each'
> [#a47cf0a740cd] /home/vagrant/.rbenv/versions/2.3.0/lib/ruby/gems/2.3.0/gems/guard-2.13.0/lib/guard/runner.rb:20:in `block in run'
> [#a47cf0a740cd] /home/vagrant/.rbenv/versions/2.3.0/lib/ruby/gems/2.3.0/gems/lumberjack-1.0.10/lib/lumberjack.rb:32:in `unit_of_work'
> [#a47cf0a740cd] /home/vagrant/.rbenv/versions/2.3.0/lib/ruby/gems/2.3.0/gems/guard-2.13.0/lib/guard/runner.rb:18:in `run'
> [#a47cf0a740cd] /home/vagrant/.rbenv/versions/2.3.0/lib/ruby/gems/2.3.0/gems/guard-2.13.0/lib/guard/commander.rb:82:in `run_all'
> [#a47cf0a740cd] /home/vagrant/.rbenv/versions/2.3.0/lib/ruby/gems/2.3.0/gems/guard-2.13.0/lib/guard/internals/queue.rb:42:in `block in _run_actions'
> [#a47cf0a740cd] /home/vagrant/.rbenv/versions/2.3.0/lib/ruby/gems/2.3.0/gems/guard-2.13.0/lib/guard/internals/queue.rb:37:in `each'
> [#a47cf0a740cd] /home/vagrant/.rbenv/versions/2.3.0/lib/ruby/gems/2.3.0/gems/guard-2.13.0/lib/guard/internals/queue.rb:37:in `_run_actions'
> [#a47cf0a740cd] /home/vagrant/.rbenv/versions/2.3.0/lib/ruby/gems/2.3.0/gems/guard-2.13.0/lib/guard/internals/queue.rb:21:in `process'
> [#a47cf0a740cd] /home/vagrant/.rbenv/versions/2.3.0/lib/ruby/gems/2.3.0/gems/guard-2.13.0/lib/guard/commander.rb:43:in `start'
> [#a47cf0a740cd] /home/vagrant/.rbenv/versions/2.3.0/lib/ruby/gems/2.3.0/gems/guard-2.13.0/lib/guard/cli/environments/valid.rb:16:in `start_guard'
> [#a47cf0a740cd] /home/vagrant/.rbenv/versions/2.3.0/lib/ruby/gems/2.3.0/gems/guard-2.13.0/lib/guard/cli.rb:122:in `start'
> [#a47cf0a740cd] /home/vagrant/.rbenv/versions/2.3.0/lib/ruby/gems/2.3.0/gems/thor-0.19.1/lib/thor/command.rb:27:in `run'
> [#a47cf0a740cd] /home/vagrant/.rbenv/versions/2.3.0/lib/ruby/gems/2.3.0/gems/thor-0.19.1/lib/thor/invocation.rb:126:in `invoke_command'
> [#a47cf0a740cd] /home/vagrant/.rbenv/versions/2.3.0/lib/ruby/gems/2.3.0/gems/thor-0.19.1/lib/thor.rb:359:in `dispatch'
> [#a47cf0a740cd] /home/vagrant/.rbenv/versions/2.3.0/lib/ruby/gems/2.3.0/gems/thor-0.19.1/lib/thor/base.rb:440:in `start'
> [#a47cf0a740cd] /home/vagrant/.rbenv/versions/2.3.0/lib/ruby/gems/2.3.0/gems/guard-2.13.0/lib/guard/aruba_adapter.rb:32:in `execute'
> [#a47cf0a740cd] /home/vagrant/.rbenv/versions/2.3.0/lib/ruby/gems/2.3.0/gems/guard-2.13.0/lib/guard/aruba_adapter.rb:19:in `execute!'
> [#a47cf0a740cd] /home/vagrant/.rbenv/versions/2.3.0/lib/ruby/gems/2.3.0/gems/guard-2.13.0/bin/_guard-core:11:in `<main>'
07:36:42 - INFO - Guard::RSpec has just been fired
[1] guard(main)>

1 个答案:

答案 0 :(得分:1)

最好在Guard-RSpec中为这些事情打开一个问题。 (您将获得更快的响应和修复,并且您将知道修复程序何时发布等。)

首先,升级到guard-rspec 4.6.5。这只是为了确保你没有其他问题。

现在,您有两个选择:

  1. 避免删除整个tmp目录,只删除您在那里创建的文件。这是&#34;最好的&#34;解决方案,因为多个工具可以在那里创建文件。

  2. 如果你真的想自己删除tmp,那么只需手动将results_file选项设置为tmp / rspec_guard_result以外的其他选项,例如

    guard :rspec, results_file: 'guardfile_results.txt' do