简体   繁体   中英

library undef issue running rebar3 release

I'm having a strange issue that I can't, for the life of me, figure out. I have a rebar3 app that I have generated a release from. If I run the app using rebar3 shell it runs fine, but if I run the release script with _build/prod/rel/app_name/bin/app_name it starts but fails when the code goes to start lager. When it attempts to run lager:start it returns an undef which results in the app terminating. I've scoured through every aspect of the app configuration and can't find anything that points to why this is not working. Any one have any insights?

rebar.conf

{erl_opts, [debug_info]}.
{deps, [
    {ranch, {git, "https://github.com/ninenines/ranch.git", {tag, "1.4.0"}}},
    {lager, {git, "https://github.com/erlang-lager/lager.git", {tag, "3.5.1"}}},
    {mongodb, {git, "https://github.com/comtihon/mongodb-erlang.git", {tag, "v3.0.2"}}},
    {eredis, {git, "https://github.com/wooga/eredis.git", {tag, "v1.1.0"}}}
       ]}.

{relx, [
    {release, { tyranny_authservice, "0.1.0" }, [tyranny_authservice, sasl] },
        {sys_config, "./config/sys.config"},
        {vm_args, "./config/vm.args"},
        {dev_mode, false},
        {include_erts, true},
        {extended_start_script, true}
       ]
}.

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

{plugins, [rebar3_hex]}.

{erl_opts, [
        {parse_transform, lager_transform}
  ]}.
  1. Try to include lager as depended application to tyranny_authservice.app.src like this:

    {applications, [kernel, stdlib, lager]}.

  2. Another option is to add the

    {included_applications, [lager]}

in application resource file tyranny_authservice.app.src

The technical post webpages of this site follow the CC BY-SA 4.0 protocol. If you need to reprint, please indicate the site URL or the original address.Any question please contact:yoyou2525@163.com.

 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM