I have an erlang project and i'm going to generate an self-contained erlang escript for it, to do so I used the rebar escriptize, adding all the dependencies in my rebar.conf and some other options to it, as you can see
{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]}.
and, of course I've created a main method in my main module to start the script. When I run the generetaed script using the escript multiscreen_ws_app command, I see my program output just fine, but when i receive my first websocket pagckage and try to decrypt it BAM, it just don't work and I get the message:
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.
the curious fact is that it tries to search inside my script file, like it was a folder! c:/Users/alessandro.herculano/Music/multiscreen_ws_app/crypto/priv/lib/crypto but multiscreen_ws_app is my script file! what can I do to make my script search for it in another pre-defined location?
-------Some points that might be important----
Just found the solution, my fault, simply remove "crypto" from escript_incl_apps list solves the problem.