문제

A simple application based on Webmachine and ErlyDtl when I start it with ./start it works. If I try to do a release with rebar then it starts but when I exeute a request then it will fail with following error. I've tried to include the compiler ... still does not help something else is missing but no idea how to detect.

{error,
{error,undef,
    [{erlydtl_runtime,find_value,[param,[{param,"Slartibartfast"}]],[]},
     {index_dtl,render_internal,4,[]},
     {index_dtl,render,2,[]},
     {web_resource,to_html,2,[{file,"src/web_resource.erl"},{line,13}]},
     {webmachine_resource,resource_call,3,
         [{file,"src/webmachine_resource.erl"},{line,183}]},
     {webmachine_resource,do,3,
         [{file,"src/webmachine_resource.erl"},{line,141}]},
     {webmachine_decision_core,resource_call,1,
         [{file,"src/webmachine_decision_core.erl"},{line,48}]},
     {webmachine_decision_core,decision,1,
         [{file,"src/webmachine_decision_core.erl"},{line,555}]}]}}

Here is my reltool.config

{sys, [
   {lib_dirs, ["../apps", "../deps"]},
   {erts, [{mod_cond, derived}, {app_file, strip}]},
   {app_file, strip},
   {rel, "numbes", "1",
    [
     web,
     cowboy,
     crypto,
    ranch,
    kernel,
    mochiweb,
    compiler,
    webmachine,
     stdlib,
     inets,
     sasl
    ]},
   {rel, "start_clean", "",
    [
     kernel,
     stdlib
    ]},
   {boot_rel, "numbes"},
   {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, cowboy, [{incl_cond, include}]},
   {app, crypto, [{incl_cond, include}]},
   {app, inets, [{incl_cond, include}]},
   {app, mochiweb, [{incl_cond, include}]},
   {app, ranch, [{incl_cond, include}]},
   {app, compiler, [{incl_cond, include}]},
   {app, webmachine, [{incl_cond, include}]},
   {app, web, [{incl_cond, include}]}
  ]}.

{target_dir, "numbes"}.

{overlay, [
       {mkdir, "log/sasl"},
       {copy, "files/erl", "\{\{erts_vsn\}\}/bin/erl"},
       {copy, "files/nodetool", "\{\{erts_vsn\}\}/bin/nodetool"},
       {copy, "files/numbes", "bin/numbes"},
       {copy, "files/numbes.cmd", "bin/numbes.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"}
      ]}.

Any help will be greatly appreciated.

도움이 되었습니까?

해결책

The only thing I can tell looking at the log file is that the module erlydtl_runtime is not included in the release, or at least not in the search path.

It is normal that the application start even with missing module, by default the application will try to load a module only when it calls it for the first time.

라이센스 : CC-BY-SA ~와 함께 속성
제휴하지 않습니다 StackOverflow
scroll top