(ArgumentError) missing :adapter configuration

New to Elixir, Phoenix and Heroku.

I set up a basic installation of Phoenix, following the instructions for Heroku deployment on the site. Hello world works on my localhost. When I try to push to Heroku, it compiles a lot of files, then gets stuck:

remote: Generated ecto app
remote: ==> phoenix_ecto
remote: Compiling 4 files (.ex)
remote: Generated phoenix_ecto app
remote: ==> heroku_test_02
remote: Compiling 12 files (.ex)
remote: == Compilation error on file lib/heroku_test_02/repo.ex ==
remote: ** (ArgumentError) missing :adapter configuration in config :heroku_test_02, HerokuTest02.Repo
remote:     lib/ecto/repo/supervisor.ex:50: Ecto.Repo.Supervisor.compile_config/2
remote:     lib/heroku_test_02/repo.ex:2: (module)
remote:     (stdlib) erl_eval.erl:670: :erl_eval.do_apply/6

/lib/heroku_test_2/repo.ex looks like this:

defmodule HerokuTest02.Repo do
  use Ecto.Repo, otp_app: :heroku_test_02

Any idea what I’m supposed to modify here?

I pushed this file to github in case that helps: https://github.com/markdev/herokutest2

Thanks in advance :slight_smile:

1 Like

You have a typo in your configuration [1], change HerokuTest02.Endpoint to HerokuTest02.Repo and you should be good to go.

[1] https://github.com/markdev/herokutest2/blob/bd49c4973a2913d53fa6917f35ce86c4718d9507/config/prod.exs#L27


Made the exact same mistake following the same tutorial. Thanks for the help!

You might want to put this directive in prod.secret.exs instead, up to you:

# Configure your database
config :my_app, Myapp.Repo,
  adapter: Ecto.Adapters.Postgres,
  username: "****",
  password: "****",
  hostname: "****",
  database: "****_prod",
  pool_size: 15
1 Like