I’ve come back to Elixir after a year away. MacOS 12.4, M1 chip. Upgraded (see below for details).
After a mix new
, I cd into the project and type mix test
, to this result:
** (MatchError) no match of right hand side value: {:error, {{:EXIT, {:function_clause, [{:disk_log_sup, :start_link, [], [file: 'disk_log_sup.erl', line: 26]}, {:supervisor, :do_start_child_i, 3, [file: 'supervisor.erl', line: 414]}, {:supervisor, :do_start_child, 2, [file: 'supervisor.erl', line: 400]}, {:supervisor, :handle_start_child, 2, [file: 'supervisor.erl', line: 706]}, {:supervisor, :handle_call, 3, [file: 'supervisor.erl', line: 455]}, {:gen_server, :try_handle_call, 4, [file: 'gen_server.erl', line: 1149]}, {:gen_server, :handle_msg, 6, [file: 'gen_server.erl', line: 1178]}, {:proc_lib, :init_p_do_apply, 3, [file: 'proc_lib.erl', line: 240]}]}}, {:child, :undefined, :disk_log_sup, {:disk_log_sup, :start_link, []}, :permanent, false, 1000, :supervisor, [:disk_log_sup]}}}
(kernel 8.5.4) disk_log_server.erl:142: :disk_log_server.ensure_started/0
(kernel 8.5.4) disk_log_server.erl:52: :disk_log_server.open/1
(stdlib 4.3) ets.erl:815: :ets.tab2file/3
(mix 1.14.3) lib/mix/compilers/application_tracer.ex:220: Mix.Compilers.ApplicationTracer.write_manifest/1
(mix 1.14.3) lib/mix/compilers/application_tracer.ex:41: Mix.Compilers.ApplicationTracer.prepare/2
(mix 1.14.3) lib/mix/compilers/elixir.ex:150: Mix.Compilers.Elixir.compile/7
(mix 1.14.3) lib/mix/state.ex:15: Mix.State.lock/2
(mix 1.14.3) lib/mix/task.ex:421: anonymous fn/3 in Mix.Task.run_task/4
I’m wondering if this is some sort of permissions thing? Or if there’s crud from an earlier installation lying around somewhere?
Also note this:
528 $ mix help
** (FunctionClauseError) no function clause matching in Mix.Tasks.Iex.__info__/1
The following arguments were given to Mix.Tasks.Iex.__info__/1:
# 1
:attributes
(mix 1.14.3) Mix.Tasks.Iex.__info__/1
(mix 1.14.3) lib/mix/tasks/help.ex:178: anonymous fn/2 in Mix.Tasks.Help.build_task_doc_list/1
(elixir 1.14.3) lib/enum.ex:2468: Enum."-reduce/3-lists^foldl/2-0-"/3
(mix 1.14.3) lib/mix/tasks/help.ex:171: Mix.Tasks.Help.build_doc_list/2
(mix 1.14.3) lib/mix/tasks/help.ex:50: Mix.Tasks.Help.run/1
(mix 1.14.3) lib/mix/task.ex:421: anonymous fn/3 in Mix.Task.run_task/4
(mix 1.14.3) lib/mix/cli.ex:84: Mix.CLI.run_task/2
mix help
works outside of the new project directory.
Did this sequence of commands to get the above results.
> rm -rf ~/.mix*
> brew uninstall elixir erlang
> brew install elixir
> elixir --version
Erlang/OTP 25 [erts-13.2] [source] [64-bit] [smp:8:8] [ds:8:8:10] [async-threads:1] [jit:ns] [dtrace]
Elixir 1.14.3 (compiled with Erlang/OTP 25)
> mix new first
> cd first
> mix test
I don’t see anything weird in my .bashrc
, etc. files, and the PATH seems right:
509 $ whereis mix
mix: /usr/local/bin/mix /usr/local/share/man/man1/mix.1
510 $ ls -l /usr/local/bin/mix
lrwxr-xr-x 1 bem admin 31 Mar 15 13:19 /usr/local/bin/mix@ -> ../Cellar/elixir/1.14.3/bin/mix