Erlang 与 Rebar 一起发布:我错过了什么?

发布于 2024-11-28 23:09:11 字数 1623 浏览 0 评论 0原文

感谢这里的大力帮助,我正在构建我的第一个 Erlang 版本。还没有真正的代码,但我想了解它是如何完成的。我也咨询并遵循了 Martin 等人的一些网络教程。等,但似乎仍然缺少一些东西。

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

lloyd@Reliance:~/Programming/Erlang/learn$ sh rel/learn/bin/learn start
[: 129: Node '[email protected]' 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"]}.

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

Thanks to much help here, I'm well on my way toward building my first Erlang release. No real code yet, but I want to understand how it's done. I've consulted and followed several web tutorials as well Martin et. al., but still seem to be missing something.

When I try to start my release I get:

lloyd@Reliance:~/Programming/Erlang/learn$ sh rel/learn/bin/learn start
[: 129: Node '[email protected]' not responding to pings.: unexpected operator

Under the project directory "learn" I have:

apps  rebar  rebar.config  rel

In rebar.config, I have:

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

In ...learn/apps, I have:

zzz  zzz_lib

zzz and zzz_lib have all the right stuff in them so far as I can tell. From lean, I can clean, compile, and create docs.

In .../rel,I have:

files  learn  reltool.config

See reltool.config below.

I'm missing magic sauce, but what?

Many thanks,

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

如果你对这篇内容有疑问,欢迎到本站社区发帖提问 参与讨论,获取更多帮助,或者扫码二维码加入 Web 技术交流群。

扫码二维码加入Web技术交流群

发布评论

需要 登录 才能够评论, 你可以免费 注册 一个本站的账号。

评论(1

ˇ宁静的妩媚 2024-12-05 23:09:11

看起来您的 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"}]

Looks like your retool.config file is missing some entries for the application you have written.

The first part should look something like this.

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

Here is a sample application from Erlang and OTP in Action that I packaged up using rebar.
https://github.com/tmcgilchrist/simple_cache

The general layout I follow is

  simple_cache
          |-> apps  
          |    \-> simple_cache
          |             |-> src
          |             \-> ebin
          |
          |-> rebar.config
          |-> rel
               |-> files 
               |-> reltool.config
               \-> simple_cache

Also rather that doing

sh rel/learn/bin/learn start

use

sh rel/learn/bin/learn console

and enter

application:which_applications().

Which should list a bunch of things plus your application.
eg

[{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"}]
~没有更多了~
我们使用 Cookies 和其他技术来定制您的体验包括您的登录状态等。通过阅读我们的 隐私政策 了解更多相关信息。 单击 接受 或继续使用网站,即表示您同意使用 Cookies 和您的相关数据。
原文