It's been a while now that I sometimes get really weird errors when starting my local server (does not depend on the server, tried WEBRick and Unicorn).
I explained everything in details in this StackOverflow post
In essence I get undefined method randomly on objects, but only after server startup.
Sometimes I can trick around by lauching a pry or a debugger just before the buggy line, call manually the failing method and notice that it's working (...), then exit the debugger and see everything is working just fine.
Sometimes I can't get around the error (as I am now) and nothing seems to do the trick.
I've been working with Rails for a while now and I never encountered such issue so I hope someone would find a solution ...
The project is Rails 3.1 with 1.8.7 on RVM.
A huge kiss to my future hero ;)
do you only get this running in development? Or does it happen in test and production as well?
This seems to be only happening in my local environment.
I never encountered such an issue after deploying to production nor when running specs.
As told in the linked post ;)
@jerefrer can you try extracting it to a simple app so you can check if you see that this behavior is reproducible?
@jerefrer have you got any thing working here? Can we close this issue?
Mmmmh actually the issue is still there even after upgrading to Rails 3.2.
But there was more since my last reply. I realized this is obviously a file loading order issue since I don't really have to do any pry/debugger thing but just modify the file (add a empty space for example) and save it, then reload the page and the error is gone.
I don't have much time now to track down the error and isolate it, maybe next month. I don't know if you may close the issue or not since I don't know if it is really Rails related or just my code that is messy in some way.
Maybe you have some starting point for me to look at ?
@jerefrer how about posting a sample app ?
@arunagw That would just be what I meant by "tracking down the error and isolate it" and truly I can't afford the time to do that right now I'm sorry. But I definitly have to solve this so I will do it I think next month and let you know.
@jerefrer ok thanks!
@jerefrer did you get some time to track this issue more??
Haha c'mon it's not a month yet :)
Our product launch will be at the beginning of April and I plan to do just that after the launch and the early feedbacks/tweaks.
@jerefrer how about now?
Closing this for now. I will keep track on this. Please reopen this when you got something :-)