Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

No such file or directory @ rb_sysopen - tmp/rspec_guard_result with a syntax error #362

Closed
dima4p opened this issue Mar 16, 2016 · 13 comments
Labels

Comments

@dima4p
Copy link

dima4p commented Mar 16, 2016

In the case of syntax error in the code RSpecProcess does not create formatter_tmp_file, so Guard::RSpec::Results.new generates an exception and guard fails.

Sorry, I can not now create PR, but the problem is fixed by writing the line results.rb#11 as follow:
lines = File.readlines(filename) rescue ['Syntax error']

@e2
Copy link
Contributor

e2 commented Mar 16, 2016

Can you at least hint what kind of syntax error causes this?
(Not every syntax errors results in this error).

Also, the fix needs to be handled at a higher level (I have an idea for this, but I need to reproduce this).

I can't accept this fix due to:

  1. Other file related errors are hidden
  2. Silencing the errors with no details of what failed (Generic rescue statements like this were used before - and they caused extremely hard to debug problems)

I can't reproduce this problem. The syntax errors I come up with just show up as syntax errors.

@e2 e2 added the info needed label Mar 16, 2016
@dima4p
Copy link
Author

dima4p commented Mar 16, 2016

yes, in a model
validates :name, presence: tru

@dima4p
Copy link
Author

dima4p commented Mar 16, 2016

I agree, that higher level is better ;-)

@e2
Copy link
Contributor

e2 commented Mar 16, 2016

I can't reproduce this.

I'm correctly getting: undefined local variable or method 'tru' for #<Class:0x000000062e0b98> (NameError)

It may depend how model classes are loaded, rails version, spring, etc.

@ryan2johnson9
Copy link

thanks dima4p for getting me back up and running, even if it is not ideal..
I got this error after changing back to MRI-2.3 from rbx-2.5.7
in case it helps
I'm running

spring-1.7.1
guard-2.13.0
guard-rspec-4.6.5
rspec-3.4.0
rspec-rails-3.4.2
rails-4.1.6

@e2
Copy link
Contributor

e2 commented May 6, 2016

Gosh, I'd be happy to fix this quickly (and release a fix) if I could only reproduce this.

Could someone copy a failing project, remove all unnecessary files, and upload it as a repo so I can reproduce this and take a look?

@dima4p
Copy link
Author

dima4p commented May 20, 2016

Please, try to run with Spork. I meet this problem in the projects that use it.

@e2
Copy link
Contributor

e2 commented May 20, 2016

@dima4p - could you create a small repo to reproduce the problem so I can work on this?

If someone invests a bit of time into creating and sharing a repo with the issue, I'll invest some time into fixing this and releasing a fixed version.

(I've been debugging similar issues with Zeus and it's just too easy get mixed up - so an example repository is very, very helpful).

@e2
Copy link
Contributor

e2 commented May 22, 2016

I've released v4.7.0 with extensive debugging to help resolve the issue.

So I'll close this. If it still occurs:

  1. Open a new issue
  2. Attach the full info from bundle exec guard -d.

@e2 e2 closed this as completed May 22, 2016
@e2 e2 added bug and removed info needed labels May 22, 2016
@ryan2johnson9
Copy link

ryan2johnson9 commented May 22, 2016

Thanks @e2 I will give it a try when I can. I did try to get a simple project going to illustrate the error, but could not reproduce it. Made me think it was some kind of syntactical issue within one of my many specs in the problematic project. I tried systematically commenting out specs and simplifying my guardfile but alas, the error did not go away.

@e2
Copy link
Contributor

e2 commented May 23, 2016

With the new guard-rspec release and running under bundle exec guard -d, the output alone should be enough for me to know what's going on.

Hope that helps nails this.

On Sun, May 22, 2016 at 04:28:42PM -0700, Ryan Johnson wrote:

Thanks @e2 I will give it a try when I can. I did try to get a simple project going to illustrate the error, but could not reproduce it. Made me think it was some kind of syntactical issue within one of my many specs in the problematic project. I tried systematically commenting out specs and simplifying my guardfile but ALAS, the error did not go away.


You are receiving this because you were mentioned.
Reply to this email directly or view it on GitHub:
#362 (comment)

@ryan2johnson9
Copy link

I updated to 4.7.2 and I no longer get the error. Thanks. sorry it took me so long.

@e2
Copy link
Contributor

e2 commented Jul 29, 2016

Glad you have it work. Thanks for reporting.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
Projects
None yet
Development

No branches or pull requests

3 participants