I have run the installation instructions found in the Blockscout recipe. But my system has no mix command, so clearly something is missing.
Welcome to the Elixir forum. The is a wonderful community but there is an expectation that you first help yourself. What have you tried? Have you consulted the official Elixir installation page?
You are much better off installing Erlang and Elixir through asdf
. After you do that, set up global and/or local (inside a project dir) versions and you should be good to go.
Oh, and to have the necessary tooling for downloading dependencies you should also run this after successful installations: mix local.rebar --force && mix local.hex --force
.
I use asdf
as well! It really helps pin the version to whatever we want for reproducible builds.
Here are the commands I use:
brew install asdf
asdf plugin-add elixir https://github.com/asdf-vm/asdf-elixir.git
asdf plugin-add erlang https://github.com/asdf-vm/asdf-erlang.git
asdf install
mix do local.hex, local.phx
asdf reshim elixir
Here’s the content of .tool-versions
file, that needs to be in root of your project folder, for asdf
to read:
elixir | 1.14.0-otp-25 |
erlang | 25.1.1 |
P.S. Mix is a build tool that ships with Elixir that provides tasks for creating, compiling, testing your application, managing its dependencies and much more!!
better:
mix do local.hex, local.rebar, local.phx
asdf has been my savior this past year. I even got elixir and Erlang up and running on my tablet with termux.
Hehe, I already have it.
I removed it from this post for brevity.
From the install instructions for blockscout, I’m at the point where I’m supposed to execute the following:
mix do deps.get, local.rebar --force, deps.compile
This is what I get:
** (EXIT from #PID<0.94.0>) an exception was raised:
** (UndefinedFunctionError) function :erlang.get_stacktrace/0 is undefined or private
:erlang.get_stacktrace()
(elixir) lib/kernel/cli.ex:118: anonymous fn/3 in Kernel.CLI.exec_fun/2
Did you follow the asdf
steps shown above?
I did, which is how I finally got the mix command
You’re better off uninstalling anything system-wide that relates to Erlang and Elixir and only use asdf
. It should work right away afterwards.