Skip to content

'Guard::RSpec cannot open results file' when SPEC_OPTS has been set #418

@Jamedjo

Description

@Jamedjo

Problem

Related to #348, #326 and #348

I was unable have guard detect more that one change because Guard was terminating the runner with Guard::RSpec has just been fired every time. I eventually worked out this was due to the SPEC_OPTS environment variable having been set in our docker container.

Possible solutions

First I think we should catch this error and show a warning instead of terminating, since it has been a problem in the past with multiple causes and prevents the use of this library.

To solve this particular cause we could unset the SPEC_OPS variable when spawning the new process.

Error

11:44:51 - ERROR - Guard::RSpec cannot open results file: "/home/git/gitlab/tmp/rspec_guard_result". This is likely a bugso please report this at http://github.com/guard/guard-rspec/issues/new along with as muchinformation as possible to reproduce this issue.
11:44:51 - ERROR - Guard::RSpec failed to achieve its <run_on_modifications>, exception was:
> [#] Errno::ENOENT: No such file or directory @ rb_sysopen - /home/git/gitlab/tmp/rspec_guard_result
> [#] /data/cache/bundle-2.5/gems/guard-rspec-4.7.3/lib/guard/rspec/results.rb:11:in `readlines'

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions