我正在尝试使用rebar3构建OTP版本。在该项目下有多个应用程序。所有这些应用程序都将使用lager作为日志记录框架。所以我尝试了这样的rebar.config
{erl_opts, [debug_info,
{i, "apps"}]
}.
{deps, [lager]}.
{relx, [{release, { myrel, "0.0.1" },
[app1,
app2,
sasl]},
{sys_config, "./config/sys.config"},
{vm_args, "./config/vm.args"},
{dev_mode, false},
{include_erts, false},
{extended_start_script, true}]
}.
{profiles, [{prod, [{relx, [{dev_mode, false},
{include_src, false},
{include_erts, true},
{system_libs, true}
]}]
}]
}.
依赖喜欢这个
===> Verifying dependencies...
├─ lager─3.2.1 (hex package)
│ └─ goldrush─0.1.8 (hex package)
├─ app1─1.0.0 (project app)
└─ app2─0.1.0 (project app)
' rebar3发布'看起来很好。没有显示错误。
但是,当我将“rebar3”作为prod tar'运行时,我发现存档中没有lager(和goldrush)(即myrel-0.0.1.tar.gz)。因此,当我使用命令' bin / myrel console'在生产系统中运行它时,我收到以下错误..
=ERROR REPORT==== 23-Nov-2016::13:23:01 ===
** Generic server sccp_user terminating
** Last message in was {set,1,undefined}
** When Server state == {su_state,lookup}
** Reason for termination ==
** {'module could not be loaded',
[{lager_config,get,[{lager_event,loglevel},{0,[]}],[]},
.....
知道如何解决这个问题吗?