On a fresh hanami application when running the server directly (i.e
bundle exec puma , using
bundle exec as soon as a Repository is called, the server throws a LoadError.
It seems that the Hanami boot process (
Components.resolve('all')) isn't called by
Hanami.app, that leads to
hanami-model not to be correctly initialized.
A simple fix is to call
Hanami.boot on the
config.ru just the before the
run Hanami.app or change
Hanami::Application (or the
Hanami.app method) to resolve all components. I do think the later might be more elegant. =)
Steps to reproduce the problem here
kudos to @tadejm for the repo that helped me isolate the problem.