How does ERL_LIBS work?

I’m experimenting with extending iex commands and on my mac at least it appears that both
erl and iex ignore ERL_LIBS

bbense@Telemark:~/play> env ERL_LIBS=“/Users/bbense/.iex.ebin:.” erl
Erlang/OTP 19 [erts-8.1] [source] [64-bit] [smp:4:4] [async-threads:10] [hipe] [kernel-poll:false] [dtrace]

Eshell V8.1 (abort with ^G)
1> code:where_is_file(“Elixir.Ehelper.beam”).
non_existing
2>

bbense@Telemark:~/play> env ERL_LIBS=“/Users/bbense/.iex.ebin:.” iex
Erlang/OTP 19 [erts-8.1] [source] [64-bit] [smp:4:4] [async-threads:10] [hipe] [kernel-poll:false] [dtrace]

Interactive Elixir (1.3.4) - press Ctrl+C to exit (type h() ENTER for help)
iex(1)> :code.where_is_file(‘Elixir.Ehelper.beam’)
:non_existing

1 Like

ERL_LIBS expects a “library directory”, that is a library that has a nested ebin directory inside. You seem to be setting the path to the direct ebin directory instead.

See http://erlang.org/doc/man/code.html for more information.

1 Like