Just wanted to share a specific WTF that took more time that I’d like to admit to track down and with some help.
I was in the process of moving code from lib/ to app/ and the error was a LoadError unable to autoload constant X error. Only on the first request of server load
No problems with the nesting of modules, naming of files/constants etc.
Took a while to realize that under the app folder rails doesn’t append the module name for searching so instead of app/folder_x, everything needed to be moved to app/lib/folder_x which resolved the problem
A custom error/warning message around this could be helpful.