Phoenix Elixir Distillery没有使用正确的数据库连接

时间:2017-02-19 15:59:04

标签: postgresql elixir phoenix-framework distillery

我正在尝试使用Distillery构建Phoenix应用程序,但是当我尝试启动已编译的应用程序时,我不断收到有关无法对数据库进行处理的错误。

17:44:50.925 [error] GenServer #PID<0.1276.0> terminating
** (KeyError) key :database not found in: [hostname: "localhost", username: "martinffx", types: Ecto.Adapters.Postgres.TypeModule, port: 5432, name: Glitchr.Repo.Pool, otp_app: :glitchr, repo: Glitchr.Repo, adapter: Ecto.Adapters.Postgres, pool_size: 10, ssl: true, pool_timeout: 5000, timeout: 15000, adapter: Ecto.Adapters.Postgres, pool_size: 10, ssl: true, pool: DBConnection.Poolboy]
    (elixir) lib/keyword.ex:343: Keyword.fetch!/2
    (postgrex) lib/postgrex/protocol.ex:76: Postgrex.Protocol.connect/1
    (db_connection) lib/db_connection/connection.ex:134: DBConnection.Connection.connect/2
    (connection) lib/connection.ex:622: Connection.enter_connect/5
    (stdlib) proc_lib.erl:247: :proc_lib.init_p_do_apply/3
Last message: nil

现在上面的详细信息不是我在prod.ex

中提供的内容
config :glitchr, Glitchr.Endpoint,
  http: [port: {:system, "PORT"}],
  url: [host: "localhost", port: {:system, "PORT"}],
  cache_static_manifest: "priv/static/manifest.json",
  server: true,
  root: ".",
  version: Mix.Project.config[:version],
  secret_key_base: System.get_env("SECRET_KEY_BASE")

config :glitchr, Glitchr.Repo,
  adapter: Ecto.Adapters.Postgres,
  url: System.get_env("DATABASE_URL"),
  pool_size: String.to_integer(System.get_env("POOL_SIZE") || "10"),
  ssl: true

我的数据库网址为DATABASE_URL=postgres://glitchr:password@db:5433/glitchr

为什么?我怎样才能调试我不对的内容?

0 个答案:

没有答案