Cryptography 在erlang escript中使用加密

Cryptography 在erlang escript中使用加密,cryptography,erlang,escript,Cryptography,Erlang,Escript,我有一个erlang项目,我将为它生成一个自包含的erlang escript,为此,我使用了钢筋描述,添加了我的rebar.conf中的所有依赖项和一些其他选项,如您所见 {erl_opts, [{parse_transform, lager_transform}]}. {lib_dirs,["deps"]}. {deps, [ {'lager', ".*", { git, "git://github.com/basho/lager.git", {tag, "2.0.0"}} }, {'

我有一个erlang项目,我将为它生成一个自包含的erlang escript,为此,我使用了钢筋描述,添加了我的rebar.conf中的所有依赖项和一些其他选项,如您所见

{erl_opts, [{parse_transform, lager_transform}]}.
{lib_dirs,["deps"]}.

{deps, [
{'lager', ".*", {
  git, "git://github.com/basho/lager.git", {tag, "2.0.0"}}
},
{'cowboy', ".*", {
    git, "git://github.com/ninenines/cowboy.git", {tag, "2.0.0-pre.1"}}
},
{'jsx', ".*", {
    git, "git://github.com/talentdeficit/jsx.git", {tag, "v2.0.4"}}
}
]}.


{escript_emu_args, "%%! -smp auto\n"}.
{escript_emu_args, "%%! -pz ../dir-of-some-beams\n"}.
{escript_name, "multiscreen_ws_app"}.
{escript_incl_apps,   [sasl,stdlib,kernel,ranch,crypto,cowlib,cowboy,asn1,public_key,ssl,jsx,compiler    ,syntax_tools,lager,goldrush]}.
当然,我在主模块中创建了一个main方法来启动脚本。当我使用escript multiscreen_ws_app命令运行生成的脚本时,我看到我的程序输出很好,但是当我收到我的第一个websocket页面并尝试对其进行解密BAM时,它就不起作用了,我收到消息:

17:03:30.222 [error] Unable to load crypto library. Failed with error:
"load_failed, Failed to load NIF library c:/Users/alessandro.herculano/Music/mul
tiscreen_ws_app/crypto/priv/lib/crypto: 'Couldn't load the specified method
ecificado.'"
OpenSSL might not be installed on this system.
奇怪的是,它试图在我的脚本文件中搜索,就像它是一个文件夹一样!c:/Users/alessandro.herculano/Music/multiscreen_ws_app/crypto/priv/lib/crypto,但multiscreen_ws_app是我的脚本文件!如何使脚本在另一个预定义位置搜索它

-------有些要点可能很重要----

  • 我在Windows8x64机器上运行它
  • 当我不使用脚本运行它时,我的应用程序运行得很好
  • 我已经尝试使用了代码:add_pathz main表示加密文件夹,但它也不起作用

刚刚找到解决方案,我的错,只需从escript_incl_apps列表中删除“crypto”即可解决问题