rebar:创建应用程序时错误退出:{crypto,start,[]}

发布于 2024-10-12 17:53:26 字数 647 浏览 5 评论 0原文

我严格按照此处的说明进行操作。然后我运行指令来创建应用程序项目结构,并收到以下错误。

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

有什么想法我做错了吗?

I followed the instructions here, to the letter. I then ran the instruction to create an application project structure, and got the following error.

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

Any ideas what I'm doing wrong?

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

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

发布评论

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

评论(5

逆光飞翔i 2024-10-19 17:53:27

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

It looks like your Erlang was compiled without OpenSSL (the crypto module). crypto is required for many (most?) Erlang applications. You'll need to get a version of Erlang with a working crypto module, and then you shouldn't have any problems like this.

久而酒知 2024-10-19 17:53:27

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

可能是 Erlang 已正确编译,但 OpenSSL 库对 Erlang 不可见,因此无法启动加密服务器。我在 Solaris 10 上编译了 Erlang,它没有抱怨 OpenSSL 未安装。事实上,它编译了 crypto 并将其安装在: /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 安装在非标准位置,就像在 Solaris 10 上使用 OpenCSW 安装 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

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
呢古 2024-10-19 17:53:27

我建议使用预编译的 Erlang,它可以从 Erlang 解决方案中获得: https://www .erlang-solutions.com/downloads/download-erlang-otp

也有一个适用于 Windows 的版本。

I'd recommend using precompiled Erlang which is available from Erlang Solutions: https://www.erlang-solutions.com/downloads/download-erlang-otp

There's one for Windows too.

温柔戏命师 2024-10-19 17:53:27

运行 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> 

似乎加密不起作用,因为该命令给出“确定”或“异常错误”。

需要帮助。

Getting this error when running make command:

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

The erlang details are:

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> 

Seems like crypto not working, as the command gives "Ok" or "exception error".

Help needed.

忘东忘西忘不掉你 2024-10-19 17:53:27

感谢伊万的回答。但我似乎明白了这个问题:
编译 erlang 时,ubuntu 自动更新已关闭且未安装依赖项(例如 libssh-dev)。一旦打开自动更新,它就会编译并且 make 命令运行良好。

Thanks for the answer Ivan. But it seems I figured out the issue:
The ubuntu auto updates were turned off and the dependencies were not installed while compiling erlang (e.g. libssh-dev). Once the auto update was turned on it compiled and make command ran fine.

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