Erlang can be installed with asdf by running these commands:

asdf plugin add erlang https://github.com/asdf-vm/asdf-erlang.git
asdf plugin add rebar https://github.com/Stratus3D/asdf-rebar.git

asdf set -u erlang latest
asdf set -u rebar latest

asdf install

Installing with asdf can take a long time as it builds Erlang from source. On MacOS the pre-build Erlang plugin can be used to skip this work.