How to debug issues with zeitwerk and Rails

Updated . Posted . Visible to the public.

In case you have trouble with the zeitwerk autoloader, you can check out the documentation Autoloading and Reloading Constants Show archive.org snapshot and Classic to Zeitwerk HOWTO Show archive.org snapshot for some debugging hints.

For myself it was useful to print the registered constants and the file references during the boot. Therefore you need to add Rails.autoloaders.log! at the end of your config/application.rb file. You could also run bin/rails zeitwerk:check for a more generic check.

Last edit
Emanuel
License
Source code in this card is licensed under the MIT License.
Posted by Emanuel to makandra dev (2022-06-20 16:18)