4

多亏了这里的很多帮助,我正在构建我的第一个 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

在项目目录“学习”下,我有:

apps  rebar  rebar.config  rel

在 rebar.config 中,我有:

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

在 ...learn/apps 中,我有:

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"}
       ]}.
4

1 回答 1

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"}]
于 2011-11-08T05:00:52.860 回答