admin管理员组文章数量:1406950
I have been trying to deploy to fly.io using the cli "fly launch" or "fly deploy -a [appname]"
I keep getting the following error message:
2.451 19:47:21.203 [error] Postgrex.Protocol (#PID<0.8666.0>) failed to connect: ** (ArgumentError) missing the :database key in options for AppName.Repo
my config.exs
looks like this:
...
config :appName,
ecto_repos: [appName.Repo],
generators: [timestamp_type: :utc_datetime]
config :appName, AppNameWeb.Endpoint,
url: [host: "localhost"],
adapter: Bandit.PhoenixAdapter,
render_errors: [
formats: [html: AppNameWeb.ErrorHTML, json: AppNameWeb.ErrorJSON],
layout: false
],
pubsub_server: AppName.PubSub,
live_view: [signing_salt: "Lyw8GkXj"]
...
And my runtime.exs
is this:
...
if System.get_env("PHX_SERVER") do
config :appName, AppNameWeb.Endpoint, server: true
end
if config_env() == :prod do
database_url =
System.get_env("DATABASE_URL") ||
raise """
environment variable DATABASE_URL is missing.
For example: ecto://USER:PASS@HOST/DATABASE
"""
maybe_ipv6 = if System.get_env("ECTO_IPV6") in ~w(true 1), do: [:inet6], else: []
config :appName, AppName.Repo,
ssl: true,
url: database_url,
pool_size: String.to_integer(System.get_env("POOL_SIZE") || "10"),
socket_options: maybe_ipv6
...
Any help would be much appreciated!
本文标签: elixirFailing to deploy to flyio with error missing key databaseStack Overflow
版权声明:本文标题:elixir - Failing to deploy to fly.io with error missing key :database - Stack Overflow 内容由网友自发贡献,该文观点仅代表作者本人, 转载请联系作者并注明出处:http://www.betaflare.com/web/1744951477a2634110.html, 本站仅提供信息存储空间服务,不拥有所有权,不承担相关法律责任。如发现本站有涉嫌抄袭侵权/违法违规的内容,一经查实,本站将立刻删除。
发表评论