Figured I’d jump in here with my experience with this error. I was writing an extension to MyApp.Release
(generated through mix phx.gen.release
), where I was running a new function from Ecto.Migrator
. I had failed to wrap it in Ecto.Migrator.with_repo
like the auto-generated functions had. This works fine in iex
, but when running it as a standalone built application via mix release
it wasn’t working, since the repo isn’t running (at least as far as my understanding goes).
Ecto.Migrator.migrations(MyApp.Repo) # error
Ecto.Migrator.with_repo(MyApp.Repo, &Ecto.Migrator.migrations(&1)) # success!
Hopefully this helps someone else