部署中的 Phoenix 错误:模块连接不可用

Phoenix error in deployment: module Connection is not available

我正在开发 Phoenix 应用程序,运行 遇到生产中的问题,我在调试时遇到了麻烦。

** (UndefinedFunctionError) undefined function: Connection.start_link/2 (模块连接不可用)^M Connection.start_link(Postgrex.Connection, [主机名: "localhost", 超时: 5000, otp_app: :xxx, 回购: xxx.Repo, 适配器: Ecto.Adapters.Postgres,用户名:"xxx",密码:"xxx",数据库:"xxx",扩展名:[{Ecto.Adapters.Postgres.DateTime, []}, {Postgrex.Extensions.JSON, [图书馆:毒药]}], 端口: 5432])^M (ecto) lib/ecto/adapters/connection.ex:27: Ecto.Adapters.Connection.connect/2^M (ecto) lib/ecto/pools/poolboy/worker.ex:58: Ecto.Pools.Poolboy.Worker.handle_call/3^M (标准库) gen_server.erl:629: :gen_server.try_handle_call/4^M (标准库) gen_server.erl:661: :gen_server.handle_msg/5^M (标准库) proc_lib.erl:240: :proc_lib.init_p_do_apply/3^M

是的,这是 Postgrex 中的一个错误,已在 master 上修复。只需将 :connection 添加到 mix.exs 文件中的应用程序列表即可。