In this article, I'll guide you through installing Erlang and Elixir on macOS using mise—a fast, Rust-based tool version manager.
About mise
I found mise to be a faster and more intuitive alternative to asdf. It serves as a drop-in replacement, supporting .tool-versions
files and asdf plugins, making migration seamless. Being Rust-based likely contributes to its speed improvement. You can find a detailed comparison on the official mise page.
Prerequisites
- This guide is written for Apple Silicon Macs (I haven’t tested it on Intel-based ones).
- You’ll need Homebrew installed. If you don’t have it yet, check out Homebrew’s installation guide.
Mise installation and configuration
To get started, the first step is to install mise, which will help manage tool versions efficiently.
brew install mise
Configure your shell
To ensure mise works properly, you need to activate it in your shell. Depending on which shell you use, add the appropriate line to your configuration file:
# If you use Zsh, add the following line to ~/.zshrc
eval "$(mise activate zsh)"
# If you use Bash, add the following line to ~/.bashrc
eval "$(mise activate bash)"
After making the change, restart your terminal or open a new tab. Then, verify that mise is installed correctly by running:
mise -v
If everything is set up properly, this command should return the installed version of mise.
Erlang and Elixir installation
I ran into issues getting Erlang to work properly without installing OpenSSL first. The default macOS OpenSSL version just didn’t cut it—some encryption functions would fail. To avoid that headache, install OpenSSL via Homebrew.
brew install openssl
Install Erlang
Elixir and Erlang versions are independent, so you need to make sure you’re using a compatible pair. The easiest way is to check the compatibility table in the Hex Docs.
At the time I wrote this, Elixir 1.18.2 works with Erlang 25–27, so I just went for the latest available.
mise install erlang@27.2.2
Install Elixir
Installing Elixir follows the same pattern as Erlang—just specify the tool and the version you want:
mise install elixir@1.18.2
Set default, global versions
To avoid manually switching versions every time, set these as the global defaults.
mise use -g erlang
mise use -g elixir
Verify installation
Finally, check if Elixir was installed correctly. If everything went well, you should see the Elixir version along with the Erlang/OTP version.
elixir -v
That should be it! 🎉 If you run into any issues, try experimenting with different Erlang versions or double-checking the OpenSSL installation—it was the main thing that tripped me up.
If this guide helped you, feel free to leave a like or drop a comment with your experience! 🚀
Top comments (0)