【发布时间】:2015-10-07 04:23:52
【问题描述】:
我有一个 erlang 项目,我将为它生成一个独立的 erlang escript,为此我使用了 rebar escriptize,将所有依赖项添加到我的 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]}.
当然,我在主模块中创建了一个主方法来启动脚本。当我使用 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 是我的脚本文件!我该怎么做才能让我的脚本在另一个预定义的位置搜索它?
-------一些可能很重要的点----
- 我在 Windows 8 x64 机器上运行它
- 当我不使用脚本运行它时,我的应用程序运行良好
- 我已经尝试在我的顶部使用 code:add_pathz main 指示加密文件夹,但它也不起作用。
【问题讨论】:
标签: cryptography erlang escript