Search code examples
erlangrebar3

I got the error: 'EXIT',{undef,[{compile,forms, ... when start the application generated by rebar3 release


The application can run well started by erlang shell -erl, but got the error:

{"Kernel pid terminated",application_controller,"
{application_start_failure,gateway,{bad_return,{{gateway_app,start,[normal,[]]},
{'EXIT',{undef,[{compile,forms, ...

when started from _build/default/rel/xmxx/bin/xmxx.

the rebar.config is

{erl_opts, 
    [debug_info,
        {i, "include"},
        {outdir, "./ebin"},
        {src_dirs, ["src", "../../src"]}]}.
{deps, []}.

{relx, [{release, {xmxx, "0.0.1"}, [gateway, kernel, stdlib, sasl]},

    {sys_config, "./config/sys.config"},
    {vm_args, "./config/vm.args"},

    {dev_mode, true},
    {include_erts, false},
    {extended_start_script, true}]
}.

{profiles, 
    [{prod, 
        [{relx, [
            {dev_mode, false},
            {include_erts, true},
            {include_src, false}]
        }]
    }]
}.

the gateway.app.src is

{application, gateway, [
    {description, "This is server gateway."},
    {vsn, "0.0.1"},
    {registered, [gateway_sup]},
    {mod, {gateway_app, []}},
    {applications, [kernel, crypto, stdlib, sasl]},
    {env,[]},
    {modules, [xmxx_run]},
    {maintainers, []},
    {licenses, []},
    {links, []}
]}.

Any help would be appreciated!


Solution

  • It's complaining about compile:forms being undefined, probably because compile is in compiler application which you don't include.