9

我按照这里的说明,信守承诺。然后我运行指令来创建一个应用程序项目结构,并得到以下错误。

$ ./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}]}}

任何想法我做错了什么?

4

5 回答 5

12

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

于 2011-01-20T01:34:48.183 回答
6

A clarification to YOUR ARGUMENT IS VALID's answer (adding as an answer because the comment is too short).

It may be that Erlang was compiled properly but the OpenSSL libraries are not visible to Erlang, so the crypto server can't be started. I compiled Erlang on Solaris 10 and it didn't complain about OpenSSL not being installed. In fact, it compiled crypto and installed it in: /usr/local/lib/erlang/lib/crypto-2.2/

But Rebar still wasn't working. It's easy to check if the problem is indeed with the crypto module.

Open Erlang shell and type crypto:start(). This was happening on my system:

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'"}}

If OpenSSL is installed in a non-standard location, as it is the case when using OpenCSW to install OpenSSL on Solaris 10, it is easy to fix the problem by adding the library path to the environment variable. For example on Solaris 10 to /etc/profile:

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

Then log-out and log-in or re-load the bash environment, for example like this:

bash-3.2# . /etc/profile

Result:

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
于 2013-02-08T16:00:27.217 回答
1

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

Windows 也有一个。

于 2012-11-01T01:12:13.353 回答
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> 

似乎加密不起作用,因为命令给出“Ok”或“exception error”。

需要帮助。

于 2016-04-21T11:36:22.323 回答
0

感谢伊万的回答。但似乎我发现了问题:在编译erlang(例如libssh-dev)时关闭了ubuntu自动更新并且没有安装依赖项。打开自动更新后,它会编译并 make 命令运行良好。

于 2016-05-04T07:44:22.340 回答