rebar:create-app上的错误退出:{crypto,start,[]}

时间:2011-01-20 00:06:06

标签: erlang rebar

我遵循了here的说明。然后我运行了创建应用程序项目结构的指令,并得到以下错误。

$ ./rebar create-app appid=myapp
Uncaught error in rebar_core: {'EXIT',
                              {undef,
                                  [{crypto,start,[]},
                                   {rebar_core,run,1},
                                   {rebar,main,1},
                                   {escript,run,2},
                                   {escript,start,1},
                                   {init,start_it,1},
                                   {init,start_em,1}]}}

任何想法我做错了什么?

5 个答案:

答案 0 :(得分:11)

看起来你的Erlang是在没有OpenSSL(加密模块)的情况下编译的。许多(大多数?)Erlang应用程序需要加密。你需要得到一个带有工作加密模块的Erlang版本,然后你不应该有这样的问题。

答案 1 :(得分:6)

对您的论据的澄清是有效的答案(因为评论太短而添加作为答案)。

可能是Erlang编译正确但是Erlang看不到OpenSSL库,因此无法启动加密服务器。我在Solaris 10上编译了Erlang,并没有抱怨没有安装OpenSSL。事实上,它编译了加密并将其安装在:/usr/local/lib/erlang/lib/crypto-2.2/

但是Rebar仍然无法正常工作。很容易检查加密模块是否确实存在问题。

打开Erlang shell并输入crypto:start()。这发生在我的系统上:

bash-3.2# erl
Erlang R15B03 (erts-5.9.3.1) [source] [smp:2:2] [async-threads:0] [hipe] [kernel-poll:false]

Eshell V5.9.3.1  (abort with ^G)
1> crypto:start().
** exception error: undefined function crypto:start/0
2>
=ERROR REPORT==== 8-Feb-2013::15:28:43 ===
Unable to load crypto library. Failed with error:
"load_failed, Failed to load NIF library: 'ld.so.1: beam.smp: fatal: relocation error: file /usr/local/lib/erlang/lib/crypto-2.2/priv/lib/crypto.so: symbol DES_ede3_cfb_encrypt: referenced symbol not found'"
OpenSSL might not be installed on this system.

=ERROR REPORT==== 8-Feb-2013::15:28:43 ===
The on_load function for module crypto returned {error,
                                                 {load_failed,
                                                  "Failed to load NIF library: 'ld.so.1: beam.smp: fatal: relocation error: file /usr/local/lib/erlang/lib/crypto-2.2/priv/lib/crypto.so: symbol DES_ede3_cfb_encrypt: referenced symbol not found'"}}

如果OpenSSL安装在非标准位置,就像使用OpenCSW在Solaris 10上安装OpenSSL一样,可以通过将库路径添加到环境变量来轻松解决问题。例如,在Solaris 10到/ etc / profile:

LD_LIBRARY_PATH=${LD_LIBRARY_PATH}:/opt/csw/lib
export LD_LIBRARY_PATH

然后注销并登录或重新加载bash环境,例如:

bash-3.2# . /etc/profile

结果:

bash-3.2# erl
Erlang R15B03 (erts-5.9.3.1) [source] [smp:2:2] [async-threads:0] [hipe] [kernel-poll:false]

Eshell V5.9.3.1  (abort with ^G)
1> crypto:start().
ok

答案 2 :(得分:1)

我建议使用Erlang Solutions提供的预编译Erlang:https://www.erlang-solutions.com/downloads/download-erlang-otp

Windows也有一个。

答案 3 :(得分:1)

运行make命令时出现此错误:

root@hs:/var/www/html/ejabberd-master# make
rm -rf deps/.got
rm -rf deps/.built
/usr/local/lib/erlang/bin/escript rebar get-deps && :> deps/.got
Uncaught error in rebar_core: {'EXIT',
                           {undef,
                            [{crypto,start,[],[]},
                             {rebar,run_aux,2,
                              [{file,"src/rebar.erl"},{line,163}]},
                             {rebar,main,1,
                              [{file,"src/rebar.erl"},{line,58}]},
                             {escript,run,2,
                              [{file,"escript.erl"},{line,757}]},
                             {escript,start,1,
                              [{file,"escript.erl"},{line,277}]},
                             {init,start_it,1,[]},
                             {init,start_em,1,[]}]}}
make: *** [deps/.got] Error 1

erlang的详细信息是:

root@hs:/home/node# erl
Erlang/OTP 18 [erts-7.0] [source] [64-bit] [smp:4:4] [async-    threads:10] [hipe] [kernel-poll:false]

Eshell V7.0  (abort with ^G)
1> crypto:start()
1> 

似乎加密不起作用,因为命令给出了#34; Ok"或"异常错误"。

需要帮助。

答案 4 :(得分:0)

感谢伊万的回答。但似乎我想出了这个问题: 关闭ubuntu自动更新并在编译erlang时未安装依赖项(例如libssh-dev)。打开自动更新后,它编译并使命令运行正常。

相关问题