2

我正在尝试使用 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 release' 看起来不错。没有显示错误。

但是,当我运行“rebar3 as prod tar”时,我发现存档中没有包含啤酒(和 goldrush)(即 myrel-0.0.1.tar.gz)。因此,当我使用命令“bin/myrel 控制台”在生产系统中运行它时,出现以下错误。

=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,[]}],[]},
.....

知道如何解决这个问题吗?

4

0 回答 0