Anyone game to dredge up memories of your Rails 5 -> 6 upgrade?
I’m running bin/rails zeitwerk:check
and while it is, at the end, telling me All is good!
I do get a pretty big deprecation warning:
DEPRECATION WARNING: Initialization autoloaded the constants [a long list of about 51 classnames].
Being able to do this is deprecated. Autoloading during initialization is going
to be an error condition in future versions of Rails.
Reloading does not reboot the application, and therefore code executed during
initialization does not run again. So, if you reload [the first constant], for example,
the expected changes won't be reflected in that stale Class object.
These autoloaded constants have been unloaded.
Please, check the "Autoloading and Reloading Constants" guide for solutions.
The class names listed are mostly (but not all) helpers. I’ve been able to address a couple of them by finding places that these classes were being loaded by initialization, but now I’m at a loss trying to track down the others.
We are not modifying config.autoload_paths
or config.eager_load_paths
at all.
Any debugging tips? I tried adding Rails.autoloaders.log!
but it doesn’t really tell me anything about where these are getting loaded during initialization. Some kind of stacktrace would be awesome.
Any suggestions? Thanks!