asdf-elixir: Running mix gives an exec: erl: not found error

Did the following steps successfully:

$ asdf install erlang 21.2.3
$ asdf install elixir 1.8.0

$ asdf global erlang 21.2.3
$ asdf global elixir 1.8.0

but getting an error when running mix, is there a step I’m missing?

image

About this issue

  • Original URL
  • State: closed
  • Created 5 years ago
  • Reactions: 5
  • Comments: 19 (5 by maintainers)

Most upvoted comments

I’ve been working around this by pinning an earlier version of asdf

git clone -b v0.6.3 --single-branch https://github.com/asdf-vm/asdf.git ~/.asdf

Then doing plugin-adds and installs as usual.

still failed after asdf reshim. Using asdf version 0.8.0.

Same here:

➜  asdf --version 
v0.8.0
➜  asdf current elixir
elixir          1.10.0-otp-22   /Users/david/.tool-versions
➜  asdf current erlang
erlang          22.3.1          /Users/david/.tool-versions

On MacOS Catalina 10.15.7

I am getting this same error when I try to run any mix command. I am using ubuntu 20.10

It used to work perfectly, but than I had to remove and reinstall the erlang plugin and this problem started to happen

Not working on CentOS 9 Stream in 2024.

output
# asdf reshim
# asdf exec erl
Erlang/OTP 26 [erts-14.2.3] [source] [64-bit] [smp:96:96] [ds:96:96:10] [async-threads:1] [jit:ns] [systemtap]

Eshell V14.2.3 (press Ctrl+G to abort, type help(). for help)
1>
BREAK: (a)bort (A)bort with dump (c)ontinue (p)roc info (i)nfo
       (l)oaded (v)ersion (k)ill (D)b-tables (d)istribution
^C# asdf exec mix
/opt/asdf/installs/elixir/1.16.2-otp-26/bin/elixir: line 247: exec: erl: not found
# asdf which erl
/opt/asdf/installs/erlang/26.2.3/bin/erl
# asdf which mix
/opt/asdf/installs/elixir/1.16.2-otp-26/bin/mix
# asdf info
OS:
Linux 3fcb8b6af51e 5.14.0-430.el9.x86_64 #1 SMP PREEMPT_DYNAMIC Thu Mar 14 17:54:49 UTC 2024 x86_64 x86_64 x86_64 GNU/Linux

SHELL:
GNU bash, version 5.1.8(1)-release (x86_64-redhat-linux-gnu)
Copyright (C) 2020 Free Software Foundation, Inc.
License GPLv3+: GNU GPL version 3 or later <http://gnu.org/licenses/gpl.html>

This is free software; you are free to change and redistribute it.
There is NO WARRANTY, to the extent permitted by law.

BASH VERSION:
5.1.8(1)-release

ASDF VERSION:
v0.14.0-ccdd47d

ASDF INTERNAL VARIABLES:
ASDF_DEFAULT_TOOL_VERSIONS_FILENAME=.tool-versions
ASDF_DATA_DIR=/opt/asdf
ASDF_DIR=/opt/asdf
ASDF_CONFIG_FILE=/etc/asdfrc

ASDF INSTALLED PLUGINS:
elixir                       https://github.com/asdf-vm/asdf-elixir master a4c42e1
erlang                       https://github.com/asdf-vm/asdf-erlang master cf6ac67
golang                       https://github.com/asdf-community/asdf-golang master 033730c
nodejs                       https://github.com/asdf-vm/asdf-nodejs master c5b7c40
python                       https://github.com/asdf-community/asdf-python master 5e277e2
v                            https://github.com/jthegedus/asdf-v main 17bcf55

Invalid resolution: . "${ASDF_DIR}/asdf.sh" or add shims to PATH. Neither of these are suitable resolutions because the system requires a specific version of python, or it breaks everything and defeats the purpose of isolated environments.

Conclusion: asdf exec isn’t environmentally clean and idempotent.

Same issue here on Mac Monterrey 😕

still failed after asdf reshim. Using asdf version 0.8.0.

This should not be an issue with the latest version of asdf (version 0.8.0). If the steps listed in this issue don’t work trying running asdf reshim.