gpt4 book ai didi

Issue with running a compiled rebar3 erlang application with erl -pa(使用erl-pa运行已编译的rebar3 Erlang应用程序的问题)

转载 作者:bug小助手 更新时间:2023-10-24 21:10:20 26 4
gpt4 key购买 nike



An erlang OTP application (nerlnetApp) that depends on cowboy compiled and run successfully when executed using the command: rebar3 shell, from application directory.

一个依赖牛仔的Erlang OTP应用程序(NerlnetApp),在使用以下命令执行时成功编译和运行:rebar3 shell,从应用程序目录。


However, erlang shell cannot run in CI environment and therefore we decide to run it using the following method:

但是,Erlang外壳不能在CI环境中运行,因此我们决定使用以下方法运行它:


erl -pa jsx/ebin ranch/ebin cowlib/ebin cowboy/ebin nerlnetApp/ebin -eval "nerlnetApp_app:start(a,b)."

This command generates the following error:

此命令会生成以下错误:


{"init terminating in do_boot",
{noproc,{gen_server,call,[ranch_sup,{start_child,{{ranch_listener_sup,nerlnetInitiator},
{ranch_listener_sup,start_link,[nerlnetInitiator,ranch_tcp,#{connection_type=>supervisor,socket_opts=>[{port,8484}]},cowboy_clear,#{connection_type=>supervisor,env=>#{dispatch=>[{'_',[],[{[<<"updateJsonPath">>],[],jsonHandler,[<0.9.0>]},{[<<"isNerlnetDevice">>],[],iotHandler,[<0.9.0>]}]}]}}]},permanent,infinity,supervisor,[ranch_listener_sup]}},infinity]}}}

Link to nerlnetInitiator where init_cowboy_start_clear fails.

Link to application directory with rebar.config file.

指向nerlnetInitiator的链接,其中init_Coway_Start_Clear失败。链接到包含rebar.config文件的应用程序目录。


更多回答
优秀答案推荐

The function nerlnetApp_app:start/2 is the callback function for the application behaviour - it's not meant to be called directly. Try this instead:

函数nerlnetApp_app:start/2是应用程序行为的回调函数-它不应该被直接调用。试着这样做:


-eval "application:ensure_all_started(nerlnetApp, permanent)."

That will start all dependencies, including ranch, before starting the application itself. That should avoid the noproc error, which suggests that there is no running process named ranch_sup.

这将在启动应用程序本身之前启动所有依赖项,包括牧场。这应该可以避免noproc错误,该错误表明没有名为ranch_sup的正在运行的进程。


更多回答

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