How to use the elixir installed by the asdf instead of the homebrew?

Currently, this is what I got:

type -a mix
mix is /opt/homebrew/bin/mix
mix is /Users/cifer/.asdf/shims/mix

type -a elixir
elixir is /opt/homebrew/bin/elixir
elixir is /Users/cifer/.asdf/shims/elixir

The brew installed version is 1.17.2, asdf installed version is 1.17.1-otp-27.
I’ve already set asdf global elixir 1.17.1-otp-27.
But when I type iex in the terminal, I always get:

Interactive Elixir (1.17.2) - press Ctrl+C to exit (type h() ENTER for help)

I don’t know why is that, can anyone give me some hits?

When looking for binaries the first one found in any of the $PATH folders is used. The folders in $PATH are checked in order, front to back. So your homebrew binaries are likely found first. Generally I’d suggest not installing binaries through multiple package managers for exactly such reasons.

3 Likes
brew uninstall erlang
brew uninstall elixir
2 Likes