"NoMethodError: undefined method" after switching to unicorn

Eric Wong normalperson at yhbt.net
Thu Jun 30 01:04:20 EDT 2011

Tiago Scolari <tscolari at gmail.com> wrote:
> Hello, I'm having a lot of "NoMethodError: undefined method" errors
> after I moved from thin to unicorn.
> This seems to happen only with active records, and dynamic methods,
> like: find_by_*, scoped_by_*, ...
> It seems to be random, at least I haven't found relation yet.  I may
> reload the same page 10 times, sometimes it will work ok, some times
> it will give me this error.
> I've 2 sites having this issue, one uses rails 3.0.9 (r 1.9.2) and
> other with 2.3.8 (r 1.8.7).  As i said, the issue started after I
> switched to unicorn.
> Any idea what could cause this?

Are you using preload_app?

> vendor/plugins/rpm/lib/new_relic/agent/instrumentation/unicorn_instrumentation.rb:7:in
> `call'

Hrm, I wonder if the above file depends on (undocumented) Unicorn internals
that changed in unicorn 4.0.0?

> [GEM_ROOT]/gems/unicorn-4.0.0/lib/unicorn/http_server.rb:475:in
> `spawn_missing_workers'

It might be worth it to try unicorn 3.7.0 since 4.0.0 was just released
and some gems that depend on internal implementation details could
be broken.

Maybe somebody else here has a better explanation...

Eric Wong

More information about the mongrel-unicorn mailing list