我一般都是钢筋和二郎的初学者。我试图根据本教程创建一个带有钢筋的erlang版本:http://www.metabrew.com/article/erlang-rebar-tutorial-generating-releases-upgrades并且在运行生成的版本时陷入困境。
我的系统是Ubuntu 11.04 64bit,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,但我不知道为什么要首先加载它。该版本仅包含一个非常简单的应用程序,仅依赖于kernel和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文件中列出很多应用程序?事件如果没问题,为什么不开始发布?
答案 0 :(得分:13)
添加到reltool.config
,以下一行:
{app, hipe, [{incl_cond, exclude}]}
答案 1 :(得分:9)
首先,您可以通过向VM添加参数init_debug
来尝试查看在引导VM期间失败的内容:
$ erl -init_debug
{progress,preloaded}
{progress,kernel_load_completed}
{progress,modules_loaded}
{start,heart}
{start,error_logger}
{start,application_controller}
{progress,init_kernel_started}
...
{progress,applications_loaded}
{apply,{application,start_boot,[kernel,permanent]}}
{apply,{application,start_boot,[stdlib,permanent]}}
{apply,{c,erlangrc,[]}}
{progress,started}
Erlang R14B03 (erts-5.8.4) [source] [64-bit] [smp:4:4] [rq:4] [async-threads:0] [hipe] [kernel-poll:false]
Eshell V5.8.4 (abort with ^G)
1>
使用此功能,您将能够更详细地了解正在进行的交互。它可能是以错误的顺序加载库,您不支持本机等。
第二个问题,rel文件包含太多的应用程序。这可能是因为Rebar使用Reltool生成版本,并且可以加载不同的应用程序,具体取决于控件生成版本的精确程度(请参阅文档中的incl_cond
材料)。在Learn You Some Erlang的Release is The Word章节中有几个例子:
{sys, [
{lib_dirs, ["/home/ferd/code/learn-you-some-erlang/release/"]},
{erts, [{mod_cond, derived}, % derived makes it pick less stuff
{app_file, strip}]},
{rel, "erlcount", "1.0.0", [kernel, stdlib, ppool, erlcount]},
{boot_rel, "erlcount"},
{relocatable, true},
{profile, embedded}, % reduces the files included from each app
{app_file, strip}, % reduces the size of app files if possible
{incl_cond, exclude}, % by default, don't include apps. 'derived' is another option
{app, stdlib, [{mod_cond, derived}, {incl_cond, include}]}, % include at the app
{app, kernel, [{incl_cond, include}]}, % level overrides the
{app, ppool, [{vsn, "1.0.0"}, {incl_cond, include}]}, % exclude put earlier
{app, erlcount, [{vsn, "1.0.0"}, {incl_cond, include}]}
]}.
这会产生较小的版本。
答案 2 :(得分:0)
我不知道答案很好,但我知道我无法在几个拥有几个不同内核的CentOS版本上运行发布,所以这并不完全不寻常。升级到5.6使它最终工作。您可以在此处查看每天实际测试的操作系统:
http://www.erlang.org/doc/installation_guide/INSTALL.html#id62915
另外,我猜你可以在没有HIPE的情况下进行编译。
答案 3 :(得分:0)
最近我发现这篇文章: http://mokele.co.uk/2011/07/01/rebar-release-upgrade-caveats.html
它揭示了钢筋中的错误列表,其中之一就是我的版本无法启动的原因。还发布了修复程序。我希望他们尽快合并到主要的钢筋仓库。