sile / jsone

Erlang JSON library
MIT License
291 stars 71 forks source link

How to get jsone to work without the make script? #39

Closed WiggyWire closed 5 years ago

WiggyWire commented 5 years ago

Eshell V8.2.1 (abort with ^G) 1> jsone:decode(<<"[1,2,3]">>). ** exception error: undefined function jsone:decode/1

When I use the make start it works fine, what do I need to setup so it works with erl?

sile commented 5 years ago

make start is equivalent to rebar3 shell command. The command automatically adds the paths of the necessary ebin directories when starting Erlang shell.

If you want to start Erlang shell manually, it is needed to add the jsone's ebin directory path, for example, as follows:

$ cd jsone/
$ make compile
$ erl -pa _build/default/lib/jsone/ebin/
> jsone:decode(<<"[1,2,3]">>).
[1,2,3]
WiggyWire commented 5 years ago

Thank you.