gpt4 book ai didi

elixir - 无法启动 Phoenix 发布

转载 作者:行者123 更新时间:2023-12-02 01:11:57 26 4
gpt4 key购买 nike

昨天我遇到了非常奇怪的问题。

配置:

- Erlang 19
- Elixir 1.3.1
- Exrm 1.0.6
- Phoenix 1.2.0
- Ubuntu 15.10

步骤:

  1. 使用 MIX_ENV=prod mixcompile 编译项目
  2. 使用 MIX_ENV=prod mix release 构建版本
  3. 尝试使用 rel/susu_online/bin/susu_online 控制台测试构建的项目

然后我收到一个错误,但无法弄清楚为什么会发生这种情况

以下错误:

Erlang/OTP 19 [erts-8.0] [source-6dc93c1] [64-bit] [async-threads:10] [hipe] [kernel-poll:false]

10:37:29.758 [error] Supervisor 'Elixir.Logger.Supervisor' had child 'Elixir.Logger.ErrorHandler' started with 'Elixir.Logger.Watcher':watcher(error_logger, 'Elixir.Logger.ErrorHandler', {true,false,500}, link) at <0.1445.0> exit with reason normal in context child_terminated
10:37:29.767 [info] Application lager started on node 'susu_online@127.0.0.1'
10:37:29.767 [info] Application hpack started on node 'susu_online@127.0.0.1'
10:37:29.768 [info] Application chatterbox started on node 'susu_online@127.0.0.1'
10:37:29.768 [info] Application elixlsx started on node 'susu_online@127.0.0.1'
10:37:29.768 [info] Application poolboy started on node 'susu_online@127.0.0.1'
10:37:29.769 [info] Application poison started on node 'susu_online@127.0.0.1'
10:37:29.813 [info] Application apns started on node 'susu_online@127.0.0.1'
10:37:29.814 [info] Application httpoison started on node 'susu_online@127.0.0.1'
10:37:29.814 [info] Application pigeon started on node 'susu_online@127.0.0.1'
10:37:29.815 [info] Application combine started on node 'susu_online@127.0.0.1'
10:37:29.815 [info] Application gettext started on node 'susu_online@127.0.0.1'
10:37:29.815 [info] Application timex started on node 'susu_online@127.0.0.1'
10:37:29.815 [info] Application comeonin started on node 'susu_online@127.0.0.1'
10:37:29.816 [info] Application connection started on node 'susu_online@127.0.0.1'
10:37:29.816 [info] Application db_connection started on node 'susu_online@127.0.0.1'
10:37:29.816 [info] Application decimal started on node 'susu_online@127.0.0.1'
10:37:29.817 [info] Application postgrex started on node 'susu_online@127.0.0.1'
10:37:29.817 [info] Application ecto started on node 'susu_online@127.0.0.1'
10:37:29.818 [info] Application phoenix_ecto started on node 'susu_online@127.0.0.1'
10:37:29.818 [info] Application cowlib started on node 'susu_online@127.0.0.1'
10:37:29.818 [info] Application ranch started on node 'susu_online@127.0.0.1'
10:37:29.819 [info] Application cowboy started on node 'susu_online@127.0.0.1'
10:37:29.819 [info] Application plug started on node 'susu_online@127.0.0.1'
10:37:29.819 [info] Application phoenix_html started on node 'susu_online@127.0.0.1'
10:37:29.820 [info] Application eex started on node 'susu_online@127.0.0.1'
10:37:29.820 [info] Application phoenix started on node 'susu_online@127.0.0.1'
10:37:29.825 [info] Application susu_online exited: SusuOnline.start(:normal, []) returned an error: shutdown: failed to start child: SusuOnline.Endpoint
** (EXIT) shutdown: failed to start child: Phoenix.PubSub.PG2
** (EXIT) an exception was raised:
** (UndefinedFunctionError) function Phoenix.PubSub.PG2.start_link/2 is undefined (module Phoenix.PubSub.PG2 is not available)
Phoenix.PubSub.PG2.start_link(SusuOnline.PubSub, [fastlane: Phoenix.Channel.Server, pool_size: 1, name: SusuOnline.PubSub, adapter: Phoenix.PubSub.PG2])
(stdlib) supervisor.erl:365: :supervisor.do_start_child/2
(stdlib) supervisor.erl:348: :supervisor.start_children/3
(stdlib) supervisor.erl:314: :supervisor.init_children/2
(stdlib) gen_server.erl:328: :gen_server.init_it/6
(stdlib) proc_lib.erl:247: :proc_lib.init_p_do_apply/3
10:37:29.823 [error] Supervisor 'Elixir.SusuOnline.Endpoint' had child 'Elixir.Phoenix.PubSub.PG2' started with 'Elixir.Phoenix.PubSub.PG2':start_link('Elixir.SusuOnline.PubSub', [{fastlane,'Elixir.Phoenix.Channel.Server'},{pool_size,1},{name,'Elixir.SusuOnline.PubSub'},{adapter,...}]) at undefined exit with reason {'EXIT',{undef,[{'Elixir.Phoenix.PubSub.PG2',start_link,['Elixir.SusuOnline.PubSub',[{fastlane,'Elixir.Phoenix.Channel.Server'},{pool_size,1},{name,'Elixir.SusuOnline.PubSub'},{adapter,'Elixir.Phoenix.PubSub.PG2'}]],[]},{supervisor,do_start_child,2,[{file,"supervisor.erl"},{line,365}]},{supervisor,start_children,3,[{file,"supervisor.erl"},{line,348}]},{supervisor,init_children,2,[{file,"supervisor.erl"},{line,314}]},{gen_server,init_it,6,[{file,"gen_server.erl"},{line,328}]},{proc_lib,init_p_do_apply,...}]}} in context start_error
{"Kernel pid terminated",application_controller,"{application_start_failure,susu_online,{{shutdown,{failed_to_start_child,'Elixir.SusuOnline.Endpoint',{shutdown,{failed_to_start_child,'Elixir.Phoenix.PubSub.PG2',{'EXIT',{undef,[{'Elixir.Phoenix.PubSub.PG2',start_link,['Elixir.SusuOnline.PubSub',[{fastlane,'Elixir.Phoenix.Channel.Server'},{pool_size,1},{name,'Elixir.SusuOnline.PubSub'},{adapter,'Elixir.Phoenix.PubSub.PG2'}]],[]},{supervisor,do_start_child,2,[{file,\"supervisor.erl\"},{line,365}]},{supervisor,start_children,3,[{file,\"supervisor.erl\"},{line,348}]},{supervisor,init_children,2,[{file,\"supervisor.erl\"},{line,314}]},{gen_server,init_it,6,[{file,\"gen_server.erl\"},{line,328}]},{proc_lib,init_p_do_apply,3,[{file,\"proc_lib.erl\"},{line,247}]}]}}}}}},{'Elixir.SusuOnline',start,[normal,[]]}}}"}

Crash dump is being written to: erl_crash.dump...done
Kernel pid terminated (application_controller) ({application_start_failure,susu_online,{{shutdown,{failed_to_start_child,'Elixir.SusuOnline.Endpoint',{shutdown,{failed_to_start_child,'Elixir.Phoenix.P

** (EXIT) shutdown: failed to start child: Phoenix.PubSub.PG2 令我非常困惑。为什么项目找不到自己的模块?

最佳答案

当应用程序列表中缺少应用程序时,您通常会在使用版本时遇到此问题。

您的 mix.ex 中的应用程序列表中有 phoenix_pubsub 吗?

它应该看起来像这样:

  def application do
[mod: {MyApp, []},
applications: [:phoenix, :phoenix_pubsub, :phoenix_html, :cowboy, :logger, :gettext,
:phoenix_ecto, :postgrex]]
end

关于elixir - 无法启动 Phoenix 发布,我们在Stack Overflow上找到一个类似的问题: https://stackoverflow.com/questions/38260642/

26 4 0
Copyright 2021 - 2024 cfsdn All Rights Reserved 蜀ICP备2022000587号
广告合作:1813099741@qq.com 6ren.com