Erlang发布Rebar:我缺少什么?

时间:2011-08-08 23:20:02

标签: 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

在项目目录“learn”下我有:

apps  rebar  rebar.config  rel

在rebar.config中,我有:

{cover_enabled, true}.
{sub_dirs, ["rel","apps/zzz", "apps/zzz_lib"]}.

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

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

在... / rel中,我有:

files  learn  reltool.config

请参阅下面的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"}
       ]}.

1 个答案:

答案 0 :(得分: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}]}
  ]}.

以下是我使用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

也就是说

sh rel/learn/bin/learn start

使用

sh rel/learn/bin/learn console

并输入

  

应用: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"}]