I’m going through the recent Nitrogen book and walking someone through the setup to teach them erlang with a brand new install and they are getting an interesting error when running
make ... from a fresh
git clone https://github.com/nitrogen/nitrogen.git:
❯ make slim_cowboy PROJECT=testnitro make: Entering directory '/home/<usr>/erlang/nitrogen' ./rebar get-deps escript: exception error: undefined function rebar:main/1 in function escript:run/2 (escript.erl, line 750) in call from escript:start/1 (escript.erl, line 277) in call from init:start_em/1 in call from init:do_boot/3 make: *** [Makefile:40: get-deps] Error 127 make: Leaving directory '/home/<user>/erlang/nitrogen' make: *** [Makefile:83: slim_cowboy] Error 2
And having them run
./rebar returns the same issue:
❯ ./rebar escript: exception error: undefined function rebar:main/1 in function escript:run/2 (escript.erl, line 750) in call from escript:start/1 (escript.erl, line 277) in call from init:start_em/1 in call from init:do_boot/3
I’m pretty sure I know their issue, but I’m curious if a better and more accurate error message could be provided to such a newbie to erlang?
For note, they grabbed the old rebar 2.6.4 and replaced the one in the nitrogen clone with it then it worked (thus we continued), but that seems wrong to do?
In addition, we had a later issue but we just added the base erlang to the path instead of a shim (via asdf env erl), but this also seems very wrong and unnecessary as any other erlang thing that I do and have ran works fine with asdf?
❯ ./bin/nitrogen console Exec: /home/<user>.asdf/shims/../erts-13.0/bin/erlexec -boot_var RELTOOL_EXT_LIB /home/<user>/erlang/testnitro/lib -sasl releases_dir "/home/<user>/erlang/testnitro/releases" -boot /home/<user>/erlang/testnitro/releases/2.4.0/nitrogen -mode interactive -config /home/<user>/erlang/testnitro/etc/app.config -config /home/<user>/erlang/testnitro/etc/simple_bridge.config -config /home/<user>/erlang/testnitro/etc/sync.config -args_file /home/<user>/erlang/testnitro/etc/vm.args -- console Root: /home/<user>/.asdf/shims/.. ./bin/nitrogen: 299: exec: /home/<user>/.asdf/shims/../erts-13.0/bin/erlexec: not found