Erlang发布Rebar:我缺少什么?

Llo*_*ice 4 erlang release rebar

感谢大家的帮助,我正在构建我的第一个Erlang版本.还没有真正的代码,但我想了解它是如何完成的.我已经咨询并遵循了几个网络教程以及Martin等.al.,但似乎仍然缺少某些东西.

当我尝试开始发布时,我得到:

lloyd@Reliance:~/Programming/Erlang/learn$ sh rel/learn/bin/learn start
[: 129: Node 'learn@127.0.0.1' not responding to pings.: unexpected operator
Run Code Online (Sandbox Code Playgroud)

在项目目录"学习"我有:

apps  rebar  rebar.config  rel
Run Code Online (Sandbox Code Playgroud)

在rebar.config中,我有:

{cover_enabled, true}.
{sub_dirs, ["rel","apps/zzz", "apps/zzz_lib"]}.
Run Code Online (Sandbox Code Playgroud)

在......学习/应用程序中,我有:

zzz  zzz_lib
Run Code Online (Sandbox Code Playgroud)

据我所知,zzz和zzz_lib中包含了所有正确的东西.从精益,我可以清理,编译和创建文档.

在.../rel中,我有:

files  learn  reltool.config
Run Code Online (Sandbox Code Playgroud)

请参阅下面的reltool.config.

我错过了魔法酱,但是什么?

非常感谢,

LRP

{sys, [
   {lib_dirs, []},
   {rel, "learn", "1",
    [
     kernel,
     stdlib,
     sasl
    ]},
   {rel, "start_clean", "",
    [
     kernel,
     stdlib
    ]},
   {boot_rel, "learn"},
   {profile, embedded},
   {excl_sys_filters, ["^bin/.*",
                       "^erts.*/bin/(dialyzer|typer)"]},
   {app, sasl, [{incl_cond, include}]}
  ]}.

{target_dir, "learn"}.

{overlay, [
       {mkdir, "log/sasl"},
       {copy, "files/erl", "{{erts_vsn}}/bin/erl"},
       {copy, "files/nodetool", "{{erts_vsn}}/bin/nodetool"},
       {copy, "files/learn", "bin/learn"},
       {copy, "files/app.config", "etc/app.config"},
       {copy, "files/vm.args", "etc/vm.args"}
       ]}.
Run Code Online (Sandbox Code Playgroud)

lam*_*foo 5

看起来你的retool.config文件缺少你编写的应用程序的一些条目.

第一部分看起来应该是这样的.

{sys, [
   {lib_dirs, ["../apps"]},      <--- point to where your applications are
   {rel, "learn", "1",
    [
     <your application here>     <---- add your application(s) here 
     kernel,
     stdlib,
     sasl
    ]},
   {rel, "start_clean", "",
    [
     kernel,
     stdlib
    ]},
   {boot_rel, "learn"},
   {profile, embedded},
   {excl_sys_filters, ["^bin/.*",
                       "^erts.*/bin/(dialyzer|typer)"]},
   {app, <your application here>, [{incl_cond, include}]},      <-- and here 
   {app, sasl, [{incl_cond, include}]}
  ]}.
Run Code Online (Sandbox Code Playgroud)

以下是我使用rebar打包的Erlang和OTP in Action的示例应用程序. https://github.com/tmcgilchrist/simple_cache

我遵循的总体布局是

  simple_cache
          |-> apps  
          |    \-> simple_cache
          |             |-> src
          |             \-> ebin
          |
          |-> rebar.config
          |-> rel
               |-> files 
               |-> reltool.config
               \-> simple_cache
Run Code Online (Sandbox Code Playgroud)

而且那样做

sh rel/learn/bin/learn start
Run Code Online (Sandbox Code Playgroud)

使用

sh rel/learn/bin/learn console
Run Code Online (Sandbox Code Playgroud)

并输入

应用:which_applications().

哪个应该列出一堆东西加上你的应用程序.例如

[{mysample_app,[],[]},
 {sasl,"SASL  CXC 138 11","2.1.10"},
 {stdlib,"ERTS  CXC 138 10","1.17.5"},
 {kernel,"ERTS  CXC 138 10","2.14.5"}]
Run Code Online (Sandbox Code Playgroud)