无法启动使用 rebar 生成的示例 erlang 版本
一般来说,我是 rebar 和 erlang 的初学者。我试图根据本教程创建一个带有 rebar 的 erlang 版本: http://www.metabrew.com/article/erlang-rebar-tutorial-generate-releases-upgrades 并陷入运行生成版本的点。
我的系统是Ubuntu 11.04 64位,erlang R14B03,从源安装。
当我调用“bin/somenode console”时,出现以下错误之一:
Exec: /home/ghik/Inz/somerel/rel/somenode/erts-5.8.4/bin/erlexec -boot /home/ghik/Inz/somerel/rel/somenode/releases/1/somenode -mode embedded -config /home/ghik/Inz/somerel/rel/somenode/etc/app.config -args_file /home/ghik/Inz/somerel/rel/somenode/etc/vm.args -- console
Root: /home/ghik/Inz/somerel/rel/somenode
{"init terminating in do_boot",{'cannot load',hipe_amd64_encode,get_files}}
Crash dump was written to: erl_crash.dump
init terminating in do_boot ()
有趣的是,每次运行它时,都会列出不同的原子而不是“hipe_amd64_encode”,例如:“hipe_amd64_defuse”、“hipe_amd64_assemble”等。 我猜 erlang 无法加载 hipe,但我不知道为什么首先要尝试加载它。该版本仅包含一个非常简单的应用程序,仅依赖于内核和 stdlib。
由于某种原因,rebar 生成了一个包含大量不必要应用程序的 .rel 文件:
%% rel generated at {2011,9,6} {20,5,48}
{release,{"somenode","1"},
{erts,"5.8.4"},
[{kernel,"2.14.4"},
{stdlib,"1.17.4"},
{sasl,"2.1.9.4"},
{someapp,"1"},
{compiler,"4.7.4",load},
{crypto,"2.0.3",load},
{et,"1.4.3",load},
{gs,"1.5.13",load},
{hipe,"3.8",load},
{inets,"5.6",load},
{mnesia,"4.4.19",load},
{observer,"0.9.9",load},
{public_key,"0.12",load},
{runtime_tools,"1.8.5",load},
{ssl,"4.1.5",load},
{syntax_tools,"1.6.7.1",load},
{tools,"2.6.6.4",load},
{webtool,"0.8.8",load},
{wx,"0.98.10",load}]}.
为什么 rebar 在 .rel 文件中列出了如此多的应用程序?如果没问题,为什么发布不开始?
I'm a beginner with rebar and erlang generally. I was trying to create an erlang release with rebar according to this tutorial: http://www.metabrew.com/article/erlang-rebar-tutorial-generating-releases-upgrades and got stuck at the point of running generated release.
My system is Ubuntu 11.04 64bit, erlang R14B03, installed from sources.
When i'm invoking 'bin/somenode console', I get one of the following errors:
Exec: /home/ghik/Inz/somerel/rel/somenode/erts-5.8.4/bin/erlexec -boot /home/ghik/Inz/somerel/rel/somenode/releases/1/somenode -mode embedded -config /home/ghik/Inz/somerel/rel/somenode/etc/app.config -args_file /home/ghik/Inz/somerel/rel/somenode/etc/vm.args -- console
Root: /home/ghik/Inz/somerel/rel/somenode
{"init terminating in do_boot",{'cannot load',hipe_amd64_encode,get_files}}
Crash dump was written to: erl_crash.dump
init terminating in do_boot ()
Interestingly, each time I run it, different atom is listed instead of 'hipe_amd64_encode', for example: 'hipe_amd64_defuse', 'hipe_amd64_assemble', etc.
I'm guessing erlang is unable to load hipe, but I have no idea why is is trying to load it in the first place. The release contains only one, very simple application dependent only on kernel and stdlib.
For some reason, rebar generates a .rel file with lots of unnecessary applications:
%% rel generated at {2011,9,6} {20,5,48}
{release,{"somenode","1"},
{erts,"5.8.4"},
[{kernel,"2.14.4"},
{stdlib,"1.17.4"},
{sasl,"2.1.9.4"},
{someapp,"1"},
{compiler,"4.7.4",load},
{crypto,"2.0.3",load},
{et,"1.4.3",load},
{gs,"1.5.13",load},
{hipe,"3.8",load},
{inets,"5.6",load},
{mnesia,"4.4.19",load},
{observer,"0.9.9",load},
{public_key,"0.12",load},
{runtime_tools,"1.8.5",load},
{ssl,"4.1.5",load},
{syntax_tools,"1.6.7.1",load},
{tools,"2.6.6.4",load},
{webtool,"0.8.8",load},
{wx,"0.98.10",load}]}.
Why does rebar list soo many applications in the .rel file? And event if it's fine, why doesn't the release start?
如果你对这篇内容有疑问,欢迎到本站社区发帖提问 参与讨论,获取更多帮助,或者扫码二维码加入 Web 技术交流群。
绑定邮箱获取回复消息
由于您还没有绑定你的真实邮箱,如果其他用户或者作者回复了您的评论,将不能在第一时间通知您!
发布评论
评论(4)
添加以下行到
reltool.config
中:Add to
reltool.config
, the following line:首先,您可以尝试通过向 VM 添加参数
init_debug
来查看 VM 启动过程中出现的问题:使用此选项,您将能够更详细地查看交互类型正在进行中。可能是库以错误的顺序加载,您不支持本机等。
第二个问题,rel 文件包含太多应用程序。这可能是由于 Rebar 使用 Reltool 来生成版本,并且可以根据生成版本时控件的粒度来加载不同的应用程序(请参阅文档中的
incl_cond
材料)。 Learn You 的 Release is The Word 章节中有一些示例一些 Erlang:这应该会生成更小的版本。
First of all, you can try to see what fails during the booting of the VM by adding the arguments
init_debug
to the VM:Using this, you'll be able to see with more details the kind of interactions going on. It might be that libraries are being loaded in the wrong order, you don't support native, etc.
Second issue, the rel file containing too many applications. This is likely due to the fact that Rebar uses Reltool ot generate releases, and that different applications can be loaded depending on how granular the control is whne generating releases (see
incl_cond
material in the docs). There are a few examples for this in the Release is The Word chapter of Learn You Some Erlang:And this should generate smaller releases.
我不知道好的答案,但我确实知道我无法启动在具有几个不同内核的多个 CentOS 版本上运行的版本,因此这并不罕见。升级到5.6终于可以用了。您可以在这里查看哪些操作系统实际上每天都经过测试:
http://www.erlang .org/doc/installation_guide/INSTALL.html#id62915
另外,我猜你可以在没有 HIPE 的情况下进行编译。
I don't know the good answer, but I do know that I couldn't start a release running on several CentOS versions with a couple different kernels, so this isn't exactly unusual. Upgrading to 5.6 made it finally work. You can see which OSes actually get tested every day here:
http://www.erlang.org/doc/installation_guide/INSTALL.html#id62915
Also, you could compile without HIPE, I guess.
最近我发现了这个帖子:
http://mokele.co.uk/2011/07 /01/rebar-release-upgrade-caveats.html
它揭示了 rebar 中的一系列错误,其中之一是我的版本无法启动的原因。还发布了修复程序。我希望它们能够尽快合并到主钢筋存储库中。
Lately I found this post:
http://mokele.co.uk/2011/07/01/rebar-release-upgrade-caveats.html
It uncovers a list of errors in rebar, one of them being the reason why my release couldn't launch. There are also fixes published. I hope they will be merged into main rebar repository ASAP.