{"action":"created","issue":{"url":"https://api.github.com/repos/guard/guard-rspec/issues/348","repository_url":"https://api.github.com/repos/guard/guard-rspec","labels_url":"https://api.github.com/repos/guard/guard-rspec/issues/348/labels{/name}","comments_url":"https://api.github.com/repos/guard/guard-rspec/issues/348/comments","events_url":"https://api.github.com/repos/guard/guard-rspec/issues/348/events","html_url":"https://github.com/guard/guard-rspec/issues/348","id":118828175,"number":348,"title":"Guard::RSpec has just been fired - tmp/rspec_guard_result error","user":{"login":"jng5","id":1269507,"avatar_url":"https://avatars.githubusercontent.com/u/1269507?v=3","gravatar_id":"","url":"https://api.github.com/users/jng5","html_url":"https://github.com/jng5","followers_url":"https://api.github.com/users/jng5/followers","following_url":"https://api.github.com/users/jng5/following{/other_user}","gists_url":"https://api.github.com/users/jng5/gists{/gist_id}","starred_url":"https://api.github.com/users/jng5/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/jng5/subscriptions","organizations_url":"https://api.github.com/users/jng5/orgs","repos_url":"https://api.github.com/users/jng5/repos","events_url":"https://api.github.com/users/jng5/events{/privacy}","received_events_url":"https://api.github.com/users/jng5/received_events","type":"User","site_admin":false},"labels":[],"state":"closed","locked":false,"assignee":null,"milestone":null,"comments":9,"created_at":"2015-11-25T12:39:42Z","updated_at":"2016-04-15T19:22:49Z","closed_at":"2015-11-25T14:13:12Z","body":"I just returned to a project I left off about 4 weeks ago and suddenly have a weird error message when running specs through guard.\r\n\r\nIf I run `bundle exec rspec`, everything runs fine **without** errors.\r\n\r\nWhen I run guard, my tests pass/fail as expected, but I get a giant error that pollutes my console at the end each time:\r\n\r\n```\r\n…\r\nFinished in 2.05 seconds (files took 1.47 seconds to load)\r\n84 examples, 0 failures, 28 pending\r\n\r\nRandomized with seed 9631\r\n\r\n13:19:09 - ERROR - Guard::RSpec failed to achieve its <run_all>, exception was:\r\n> [#56B29B499E34] Errno::ENOENT: No such file or directory @ rb_sysopen - ./../../tmp/rspec_guard_result\r\n> [#56B29B499E34] /Users/julieng/.rbenv/versions/2.2.2/lib/ruby/gems/2.2.0/gems/guard-rspec-4.6.4/lib/guard/rspec/results.rb:11:in `readlines'\r\n> [#56B29B499E34] /Users/julieng/.rbenv/versions/2.2.2/lib/ruby/gems/2.2.0/gems/guard-rspec-4.6.4/lib/guard/rspec/results.rb:11:in `initialize'\r\n> [#56B29B499E34] /Users/julieng/.rbenv/versions/2.2.2/lib/ruby/gems/2.2.0/gems/guard-rspec-4.6.4/lib/guard/rspec/rspec_process.rb:46:in `new'\r\n> [#56B29B499E34] /Users/julieng/.rbenv/versions/2.2.2/lib/ruby/gems/2.2.0/gems/guard-rspec-4.6.4/lib/guard/rspec/rspec_process.rb:46:in `_read_results'\r\n> [#56B29B499E34] /Users/julieng/.rbenv/versions/2.2.2/lib/ruby/gems/2.2.0/gems/guard-rspec-4.6.4/lib/guard/rspec/rspec_process.rb:17:in `initialize'\r\n> [#56B29B499E34] /Users/julieng/.rbenv/versions/2.2.2/lib/ruby/gems/2.2.0/gems/guard-rspec-4.6.4/lib/guard/rspec/runner.rb:68:in `new'\r\n> [#56B29B499E34] /Users/julieng/.rbenv/versions/2.2.2/lib/ruby/gems/2.2.0/gems/guard-rspec-4.6.4/lib/guard/rspec/runner.rb:68:in `_really_run'\r\n> [#56B29B499E34] /Users/julieng/.rbenv/versions/2.2.2/lib/ruby/gems/2.2.0/gems/guard-rspec-4.6.4/lib/guard/rspec/runner.rb:57:in `_run'\r\n> [#56B29B499E34] /Users/julieng/.rbenv/versions/2.2.2/lib/ruby/gems/2.2.0/gems/guard-rspec-4.6.4/lib/guard/rspec/runner.rb:34:in `run_all'\r\n> [#56B29B499E34] /Users/julieng/.rbenv/versions/2.2.2/lib/ruby/gems/2.2.0/gems/guard-rspec-4.6.4/lib/guard/rspec.rb:33:in `block in run_all'\r\n> [#56B29B499E34] /Users/julieng/.rbenv/versions/2.2.2/lib/ruby/gems/2.2.0/gems/guard-rspec-4.6.4/lib/guard/rspec.rb:48:in `_throw_if_failed'\r\n> [#56B29B499E34] /Users/julieng/.rbenv/versions/2.2.2/lib/ruby/gems/2.2.0/gems/guard-rspec-4.6.4/lib/guard/rspec.rb:33:in `run_all'\r\n> [#56B29B499E34] /Users/julieng/.rbenv/versions/2.2.2/lib/ruby/gems/2.2.0/gems/guard-2.13.0/lib/guard/runner.rb:82:in `block in _supervise'\r\n> [#56B29B499E34] /Users/julieng/.rbenv/versions/2.2.2/lib/ruby/gems/2.2.0/gems/guard-2.13.0/lib/guard/runner.rb:79:in `catch'\r\n> [#56B29B499E34] /Users/julieng/.rbenv/versions/2.2.2/lib/ruby/gems/2.2.0/gems/guard-2.13.0/lib/guard/runner.rb:79:in `_supervise'\r\n> [#56B29B499E34] /Users/julieng/.rbenv/versions/2.2.2/lib/ruby/gems/2.2.0/gems/guard-2.13.0/lib/guard/runner.rb:22:in `block (3 levels) in run'\r\n> [#56B29B499E34] /Users/julieng/.rbenv/versions/2.2.2/lib/ruby/gems/2.2.0/gems/guard-2.13.0/lib/guard/runner.rb:119:in `block (2 levels) in _run_group_plugins'\r\n> [#56B29B499E34] /Users/julieng/.rbenv/versions/2.2.2/lib/ruby/gems/2.2.0/gems/guard-2.13.0/lib/guard/runner.rb:117:in `each'\r\n> [#56B29B499E34] /Users/julieng/.rbenv/versions/2.2.2/lib/ruby/gems/2.2.0/gems/guard-2.13.0/lib/guard/runner.rb:117:in `block in _run_group_plugins'\r\n> [#56B29B499E34] /Users/julieng/.rbenv/versions/2.2.2/lib/ruby/gems/2.2.0/gems/guard-2.13.0/lib/guard/runner.rb:116:in `catch'\r\n> [#56B29B499E34] /Users/julieng/.rbenv/versions/2.2.2/lib/ruby/gems/2.2.0/gems/guard-2.13.0/lib/guard/runner.rb:116:in `_run_group_plugins'\r\n> [#56B29B499E34] /Users/julieng/.rbenv/versions/2.2.2/lib/ruby/gems/2.2.0/gems/guard-2.13.0/lib/guard/runner.rb:21:in `block (2 levels) in run'\r\n> [#56B29B499E34] /Users/julieng/.rbenv/versions/2.2.2/lib/ruby/gems/2.2.0/gems/guard-2.13.0/lib/guard/runner.rb:20:in `each'\r\n> [#56B29B499E34] /Users/julieng/.rbenv/versions/2.2.2/lib/ruby/gems/2.2.0/gems/guard-2.13.0/lib/guard/runner.rb:20:in `block in run'\r\n> [#56B29B499E34] /Users/julieng/.rbenv/versions/2.2.2/lib/ruby/gems/2.2.0/gems/lumberjack-1.0.9/lib/lumberjack.rb:32:in `unit_of_work'\r\n> [#56B29B499E34] /Users/julieng/.rbenv/versions/2.2.2/lib/ruby/gems/2.2.0/gems/guard-2.13.0/lib/guard/runner.rb:18:in `run'\r\n> [#56B29B499E34] /Users/julieng/.rbenv/versions/2.2.2/lib/ruby/gems/2.2.0/gems/guard-2.13.0/lib/guard/commander.rb:82:in `run_all'\r\n> [#56B29B499E34] /Users/julieng/.rbenv/versions/2.2.2/lib/ruby/gems/2.2.0/gems/guard-2.13.0/lib/guard/internals/queue.rb:42:in `block in _run_actions'\r\n> [#56B29B499E34] /Users/julieng/.rbenv/versions/2.2.2/lib/ruby/gems/2.2.0/gems/guard-2.13.0/lib/guard/internals/queue.rb:37:in `each'\r\n> [#56B29B499E34] /Users/julieng/.rbenv/versions/2.2.2/lib/ruby/gems/2.2.0/gems/guard-2.13.0/lib/guard/internals/queue.rb:37:in `_run_actions'\r\n> [#56B29B499E34] /Users/julieng/.rbenv/versions/2.2.2/lib/ruby/gems/2.2.0/gems/guard-2.13.0/lib/guard/internals/queue.rb:21:in `process'\r\n> [#56B29B499E34] /Users/julieng/.rbenv/versions/2.2.2/lib/ruby/gems/2.2.0/gems/guard-2.13.0/lib/guard/commander.rb:43:in `start'\r\n> [#56B29B499E34] /Users/julieng/.rbenv/versions/2.2.2/lib/ruby/gems/2.2.0/gems/guard-2.13.0/lib/guard/cli/environments/valid.rb:16:in `start_guard'\r\n> [#56B29B499E34] /Users/julieng/.rbenv/versions/2.2.2/lib/ruby/gems/2.2.0/gems/guard-2.13.0/lib/guard/cli.rb:122:in `start'\r\n> [#56B29B499E34] /Users/julieng/.rbenv/versions/2.2.2/lib/ruby/gems/2.2.0/gems/thor-0.19.1/lib/thor/command.rb:27:in `run'\r\n> [#56B29B499E34] /Users/julieng/.rbenv/versions/2.2.2/lib/ruby/gems/2.2.0/gems/thor-0.19.1/lib/thor/invocation.rb:126:in `invoke_command'\r\n> [#56B29B499E34] /Users/julieng/.rbenv/versions/2.2.2/lib/ruby/gems/2.2.0/gems/thor-0.19.1/lib/thor.rb:359:in `dispatch'\r\n> [#56B29B499E34] /Users/julieng/.rbenv/versions/2.2.2/lib/ruby/gems/2.2.0/gems/thor-0.19.1/lib/thor/base.rb:440:in `start'\r\n> [#56B29B499E34] /Users/julieng/.rbenv/versions/2.2.2/lib/ruby/gems/2.2.0/gems/guard-2.13.0/lib/guard/aruba_adapter.rb:32:in `execute'\r\n> [#56B29B499E34] /Users/julieng/.rbenv/versions/2.2.2/lib/ruby/gems/2.2.0/gems/guard-2.13.0/lib/guard/aruba_adapter.rb:19:in `execute!'\r\n> [#56B29B499E34] /Users/julieng/.rbenv/versions/2.2.2/lib/ruby/gems/2.2.0/gems/guard-2.13.0/bin/_guard-core:11:in `<main>'\r\n13:19:09 - INFO - Guard::RSpec has just been fired\r\n[1] guard(main)>\r\n```\r\n\r\nNote about **`results_file`**: I purposely changed the path, so it would output in the right place. I am testing a [thor](https://github.com/erikhuda/thor) app, which generates files, so I have in my code:\r\n\r\n```ruby\r\nbefore :all do\r\n  Dir.chdir(fixtures_root)\r\nend\r\n```\r\nI thought that might be the problem, so I tried adding:\r\n```ruby\r\nafter :all do\r\n  Dir.chdir(project_root)\r\nend\r\n```\r\nwhere `fixtures_root` and `project_root` are both working helper methods.\r\n\r\nGuard/Guard::RSpec still seems to be in the wrong directory because it is creating the `tmp/rspec_guard_result` file in my `fixtures` directory.\r\n\r\nI tried fixing this by adding `results_file: './../../tmp/rspec_guard_result' ` to my `Guardfile`, which outputs the file in the correct `tmp` folder. \r\n\r\nBut the error remains. Anything else I should be trying?\r\n\r\n#### Gem Versions\r\n\r\nI ran `bundle update` in case something changed after upgrading to El Capitan in recent weeks and have the following versions install:\r\n\r\n* rspec (3.4.0)\r\n* guard-rspec (4.6.4)\r\n* guard (2.13.0)\r\n\r\n"},"comment":{"url":"https://api.github.com/repos/guard/guard-rspec/issues/comments/210605785","html_url":"https://github.com/guard/guard-rspec/issues/348#issuecomment-210605785","issue_url":"https://api.github.com/repos/guard/guard-rspec/issues/348","id":210605785,"user":{"login":"e2","id":150197,"avatar_url":"https://avatars.githubusercontent.com/u/150197?v=3","gravatar_id":"","url":"https://api.github.com/users/e2","html_url":"https://github.com/e2","followers_url":"https://api.github.com/users/e2/followers","following_url":"https://api.github.com/users/e2/following{/other_user}","gists_url":"https://api.github.com/users/e2/gists{/gist_id}","starred_url":"https://api.github.com/users/e2/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/e2/subscriptions","organizations_url":"https://api.github.com/users/e2/orgs","repos_url":"https://api.github.com/users/e2/repos","events_url":"https://api.github.com/users/e2/events{/privacy}","received_events_url":"https://api.github.com/users/e2/received_events","type":"User","site_admin":false},"created_at":"2016-04-15T19:22:49Z","updated_at":"2016-04-15T19:22:49Z","body":"@alexdean - it's best to set the results file inside the Guardfile - so that the results file is created within generated temporary directory. That way, every Guard instance will generate a different temporary directory. Or the output file could just have the PID attached."}}