【问题标题】:Works alone but not after I release it with rebar单独工作,但不是在我用钢筋释放它之后
【发布时间】:2013-02-11 23:14:33
【问题描述】:

一个基于 Webmachine 和 ErlyDtl 的简单应用程序,当我使用 ./start 启动它时它可以工作。如果我尝试使用 rebar 进行发布,那么它会启动,但是当我执行请求时,它将失败并出现以下错误。我已经尝试包含编译器...仍然没有帮助缺少其他东西但不知道如何检测。

{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}]}]}}

这是我的 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"}
      ]}.

任何帮助将不胜感激。

【问题讨论】:

  • 你能粘贴你的reltool.config吗?这可能是与this 类似的问题。
  • @legoscia reltool.config 添加

标签: erlang rebar webmachine erlangweb


【解决方案1】:

查看日志文件我唯一能看出的是模块 erlydtl_runtime 未包含在版本中,或者至少未包含在搜索路径中。

即使缺少模块,应用程序也会启动是正常的,默认情况下,应用程序只会在第一次调用时尝试加载模块。

【讨论】:

    猜你喜欢
    • 2012-10-15
    • 2012-11-03
    • 2014-12-17
    • 2023-04-06
    • 2017-05-22
    • 1970-01-01
    • 2012-08-06
    • 2016-08-05
    • 2016-08-28
    相关资源
    最近更新 更多