-
Notifications
You must be signed in to change notification settings - Fork 332
Eager loading
Dotan J. Nahum edited this page Apr 14, 2014
·
4 revisions
In threaded multi-process context, Rails' lazy loading of classes might get in the way. A common error message might look like this
2014-04-14T00:24:26Z p-26612 t-owi3y51f8 ERROR: Circular dependency detected while autoloading constant Foo
A solution is to force Rails to eager load (a good thing here):
::Rails.application.eager_load!
Should resolve class loading problems when in threaded context.
For the full discussion at https://github.com/jondot/sneakers/issues/15 - a tip by Benjamin Hüttinger,