Hello,
I am building an erlang app with rebar using jsonx module, but it seems my application can't find it.
when I execute the following code:
jsonx:decode(<<"{\"name\":\"Ivan\",\"age\":33,\"phones\":[3332211,4443322]}">>)
I get this error:
2022-09-25T17:01:32.226101+03:00 error: Error in process <0.192.0> with exit value:, {{badmatch,{error,{load_failed,"Failed to load NIF library: '/home/ivelin/Desktop/auth_app/app/_build/default/lib/jsonx/priv/jsonx.so: cannot open shared object file: No such file or directory'"}}},[{jsonx,init,0,[{file,"/home/ivelin/Desktop/auth_app/app/_build/default/lib/jsonx/src/jsonx.erl"},{line,232}]},{code_server,'-handle_on_load/5-fun-0-',1,[{file,"code_server.erl"},{line,1340}]}]}
rebar.config
{erl_opts, [debug_info]}.
{deps, [
{cowboy, {git, "https://github.com/ninenines/cowboy.git"}},
{jsonx, ".*", {git, "https://github.com/iskra/jsonx.git"}}
]}.
{shell, [
% {config, "config/sys.config"},
{apps, [app]}
]}.
my app.src
{application, app,
[{description, "An OTP application"},
{vsn, "0.1.0"},
{registered, []},
{mod, {app_app, []}},
{applications,
[kernel,
stdlib,
cowboy,
jsonx
]},
{env,[]},
{modules, []},
{licenses, ["Apache 2.0"]},
{links, []}
]}.
Why do I get this error ? How can I fix it ?