当我使用钢筋生成发布应用程序并尝试使用密钥控制台启动它时出现错误
{“init在do_boot中终止”,{'无法加载',pgsql,get_file}}。
在app.src和reltool.config的所有文件中,我添加了epgsql app。
app.src:
{application, leasing,
[
{description, ""},
{vsn, "1"},
{registered, []},
{applications, [
kernel,
stdlib,
crypto,
ssl,
public_key,
epgsql,
amqp_client,
rabbit_common
]},
{mod, { leasing_app, []}},
{env, []}
]}.
reltool.config
{sys, [
{lib_dirs, ["../deps", "../apps"]},
{erts, [{mod_cond, derived}, {app_file, strip}]},
{app_file, strip},
{rel, "leasingnode", "1",
[
kernel,
stdlib,
sasl,
crypto,
ssl,
public_key,
epgsql,
amqp_client,
rabbit_common,
leasing
]},
{rel, "start_clean", "",
[
kernel,
stdlib
]},
{boot_rel, "leasingnode"},
{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, crypto, [{incl_cond, include}]},
{app, ssl, [{incl_cond, include}]},
{app, public_key, [{incl_cond, include}]},
{app, epgsql, [{incl_cond, include}]},
{app, amqp_client, [{incl_cond, include}]},
{app, rabbit_common, [{incl_cond, include}]},
{app, leasing, [{incl_cond, include}]}
]}.
{target_dir, "leasingnode"}.
{overlay, [
{mkdir, "log/sasl"},
{copy, "files/erl", "\{\{erts_vsn\}\}/bin/erl"},
{copy, "files/nodetool", "\{\{erts_vsn\}\}/bin/nodetool"},
{copy, "files/leasingnode", "bin/leasingnode"},
{copy, "files/leasingnode.cmd", "bin/leasingnode.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"}
]}.
当我从erl shell启动时一切正常,但是当我生成发布时我有错误。 当我关闭epgsql应用程序启动确定,我看到所有应用程序(加密,ssl,public_key加载),但如果再次添加epgsql有错误。
我做错了什么?
答案 0 :(得分:1)
我自己也在努力解决同样的问题。我发现即使我将epgsql依赖项放入app文件中,但是不在代码中使用它的任何模块,那么epgsql应用程序也不包含在发行版中。原来这不是螺纹钢的问题。在引擎盖下 钢筋使用reltool。这是实际生成版本的reltool,在我看来,它使用了梁文件中的一些信息,而且本身剥离了未使用的应用程序。
为了解决这个问题,我想出了两种方法:
实际上这是一个普遍的问题,并不是特定于epgsql的。