gpt4 book ai didi

Erlang:rebar生成的包启动失败

转载 作者:行者123 更新时间:2023-12-01 09:59:08 26 4
gpt4 key购买 nike

每个人。

我有一个由 rebar generate 打包的 erlang 应用程序

这是我的 reltool.config:

{sys, [
{lib_dirs, ["../../..", "../../deps"]},
{erts, [{mod_cond, derived}, {app_file, strip}]},
{app_file, strip},
{rel, "collector", "1",
[
kernel,
stdlib,
sasl,
collector
]},
{rel, "start_clean", "",
[
kernel,
stdlib
]},
{boot_rel, "collector"},
{profile, embedded},
{incl_cond, exclude},
{excl_archive_filters, [".*"]}, %% Do not archive built libs
{excl_sys_filters, ["^bin/.*", "^erts.*/bin/(dialyzer|typer)",
"^erts.*/(doc|info|include|lib|man|src)"]},
{excl_app_filters, ["\.gitignore"]},
{app, sasl, [{incl_cond, include}]},
{app, stdlib, [{incl_cond, include}]},
{app, kernel, [{incl_cond, include}]},
{app, lager, [{incl_cond, include}]},
{app, goldrush, [{incl_cond, include}]},
{app, meck, [{incl_cond, include}]},
{app, mnesia, [{incl_cond, include}]},
{app, collector, [{incl_cond, include}, {lib_dir, ".."}]}
]}.

{target_dir, "collector"}.

{overlay, [
{mkdir, "log/sasl"},
{copy, "files/erl", "\{\{erts_vsn\}\}/bin/erl"},
{copy, "files/nodetool", "\{\{erts_vsn\}\}/bin/nodetool"},
{copy, "files/collector", "bin/collector"},
{copy, "files/collector.cmd", "bin/collector.cmd"},
{copy, "files/start_erl.cmd", "bin/start_erl.cmd"},
{copy, "files/install_upgrade.escript", "bin/install_upgrade.escript"},
{copy, "files/sys.config", "releases/\{\{rel_vsn\}\}/sys.config"},
{copy, "files/vm.args", "releases/\{\{rel_vsn\}\}/vm.args"}
]}.

编译打包一切顺利:

但是当我运行应用程序时,它无法启动:

./bin/collector console

错误输出:

Exec: /home/crackcell/repo/github/shiyan/collector/rel/collector/erts-5.10.3/bin/erlexec    -boot /home/crackcell/repo/github/shiyan/collector/rel/collector/releases/1/collector -mode embedded -config    /home/crackcell/repo/github/shiyan/collector/rel/collector/releases/1/sys.config -args_file /home/crackcell/repo/github/shiyan/collector/rel/collector/releases/1/vm.args -- console
Root: /home/crackcell/repo/github/shiyan/collector/rel/collector
Erlang R16B02 (erts-5.10.3) [source] [64-bit] [smp:4:4] [async-threads:10] [hipe] [kernel-poll:false]

15:34:40.547 [error] CRASH REPORT Process <0.284.0> with 0 neighbours exited with reason: call to undefined function erl_syntax:atom(module) in application_master:init/4 line 133
15:34:40.548 [info] Application lager exited with reason: call to undefined function erl_syntax:atom(module)
{"Kernel pid terminated",application_controller,"{application_start_failure,lager, {bad_return,{{lager_app,start,[normal,[]]},{'EXIT',{undef,[{erl_syntax,atom,[module],[]},{glc_code,abstract_module_,2,[{file,\"src/glc_code.erl\"},{line,52}]},{glc_code,abstract_module,2,[{file,\"src/glc_code.erl\"},{line,39}]},{glc_code,compile,2,[{file,\"src/glc_code.erl\"},{line,29}]},{glc,compile,2,[{file,\"src/glc.erl\"},{line,171}]},{lager_util,trace_filter,2,[{file,\"src/lager_util.erl\"},{line,366}]},{lager_app,start,2,[{file,\"src/lager_app.erl\"},{line,116}]},{application_master,start_it_old,4,[{file,\"application_master.erl\"},{line,269}]}]}}}}}"}

Crash dump was written to: erl_crash.dump

内核 pid 终止 (application_controller) ({application_start_failure,lager,{bad_return,{{lager_app,start,[normal,[]]},{'EXIT',{undef,[{erl_syntax,atom,[module], []},{glc_code,abstract_module_,2

似乎主要原因是 {'EXIT',{undef,[{erl_syntax,atom,[module],[]}但我不知道为什么它未定义(我可以手动在控制台中使用它)或如何解决它。

顺便说一句,我使用的是 Erlang R16B02。

有人能帮帮我吗?谢谢。

最佳答案

erl_syntax 是 syntax_tools 的一部分(而不是 erl_parse 可用的标准库)。您需要在钢筋配置中明确添加它,以将其作为收集器版本的一部分包含在内。

{app, syntax_tools, [{incl_cond, include}]},

请注意,rebar.config 中指定的任何内容都会复制到发布文件夹中,并且不会引用已安装的 Erlang 发布。因此需要明确添加许多工具。

关于Erlang:rebar生成的包启动失败,我们在Stack Overflow上找到一个类似的问题: https://stackoverflow.com/questions/19195294/

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