Hi all. Elixir noob here, 1st post. Apologies for the wall of text.
Trying out Elixir / Phoenix on my FreeBSD box, following the tute at Up and Running — Phoenix v1.5.8
Firstly, installed this on a fresh Ubuntu 20.10 running in a VM on the FreeBSD box, and that worked fine. Using the instructions from here - Installing Elixir - The Elixir programming language So Im confident that my procedure is correct.
On the FreeBSD host machine, I installed using
pkg install elixir
then followed the same guide as on the linux box
https://hexdocs.pm/phoenix/up_and_running.html
Get as far as mix ecto.create
and then the problems begin on the FreeBSD box
Final error is
== Compilation error in file lib/plug/debugger.ex ==
** (CompileError) lib/plug/debugger.ex:277: undefined function get_session/1
(elixir 1.10.4) src/elixir_locals.erl:114: anonymous fn/3 in :elixir_locals.ensure_no_undefined_local/3
(stdlib 3.8.2.4) erl_eval.erl:680: :erl_eval.do_apply/6
Ive gone through the loop a few times of installing extra elixir pkgs to solve similar errors, but now Ive installed the lot, and stuck with this error. Erlang is installed, and getting in and out of both the Elixir and the Erlang repl is fine.
I can see that both get_session/1
and get_session/2
are defined in deps/plug/lib/plug/conn.ex
… and if I compare those files on both my linux box and my FreeBSD box - they are identical (same md5 hash too). So its not the elixir libs at fault.
One big clue - on the FreeBSD install only - it throws a lot of warnings about redefining modules, ie - on mix ecto.create
I see these sorts of warnings on a page full of libs :
warning: redefining module Plug.Session.COOKIE (current version loaded from /usr/local/lib/elixir/bin/../lib/plug/ebin/Elixir.Plug.Session.COOKIE.beam)
lib/plug/session/cookie.ex:1
warning: redefining module Plug.Debugger (current version loaded from /usr/local/lib/elixir/bin/../lib/plug/ebin/Elixir.Plug.Debugger.beam)
lib/plug/debugger.ex:1
… there is a couple of dozen of such warnings.
Big Clue Nr 2 - There is also a file on my system
/usr/local/lib/elixir/lib/plug/lib/plug/debugger.ex
which is different to the one pulled into deps on the hello project. That version does not call get_session
anywhere, so I suspect the compiler is picking up system libs instead of dep libs.
Installed version on my system is
elixir-plug-1.4.5 Composable modules for Elixir web applications
Ideas ?