I have a Rails 3 / ruby ββ1.9.2 webapp. Every so often - and it could be only 1 request per 100,000 - I get an error message that I cannot explain.
The exact error is changing, but they seem to coincide with the fact that the instance variable in my view suddenly becomes null. The most striking example of this happened recently, where this code in the helper is
@swf_object_count||=0
@swf_object_count+=1
- raised the NoMethodError: undefined `+ 'method for nil: NilClass". However, note that the errors are not limited to this case, and these two lines of code are for illustration only, and not as something that can be solved to "solve "problem.
The error, in principle, is impossible to reproduce: I never saw it, I saw only error messages. I believe that the error first appeared when we switched from REE to ruby ββ1.9.2.
Miscellaneous information that may or may not be relevant:
- We run ruby1.9.2p290 on Solaris 10 using forked unicorn instances.
- We do not use threads or fibers (correction: our application by itself does not work, but we use NewRelic, which has a background thread for collecting / publishing statistics).
- We have a combination of .haml and .erb views, but I only saw that it comes from .haml. (We donβt have many.)
- I have never seen this happen in controller code.
- undefined "foomethod" Bar ", , Bar.foomethod. , , , Foo ivar.
. , - - ?