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

And*_*ews 8 erlang rebar

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

$ ./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}]}}
Run Code Online (Sandbox Code Playgroud)

我有什么想法我做错了吗?

YOU*_*LID 11

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

  • 如果可以,我会帮忙,但我从未在Windows上使用过Erlang. (2认同)

Gre*_*reg 6

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

可能是Erlang编译正确但是Erlang看不到OpenSSL库,因此无法启动加密服务器.我在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'"}}
Run Code Online (Sandbox Code Playgroud)

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

LD_LIBRARY_PATH=${LD_LIBRARY_PATH}:/opt/csw/lib
export LD_LIBRARY_PATH
Run Code Online (Sandbox Code Playgroud)

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

bash-3.2# . /etc/profile
Run Code Online (Sandbox Code Playgroud)

结果:

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
Run Code Online (Sandbox Code Playgroud)