loading...
Cover image for How to install erlang on macOS with asdf

How to install erlang on macOS with asdf

andresdotsh profile image Andres ・1 min read

The problem

Currently some errors are happening when we try to compile/install erlang on mac OS Catalina with any method. Looking for the solution on the web, I found a way that finally worked for me.

The solution

We have to already have installed asdf, the asdf-erlang plugin, and also homebrew.

Install dependencies

Let's install some mandatory dependencies.

brew install autoconf wxmac openssl

I recommend to install other packages too.

brew install autoconf wxmac openssl fop coreutils automake libyaml readline libxslt libtool unixodbc unzip curl

Set environment variables

Once installed these packages, we need to set two environment variables before to install asdf.

export CFLAGS="-O2 -g -fno-stack-check"
export KERL_CONFIGURE_OPTIONS="--disable-hipe --with-ssl=$(brew --prefix openssl)"

If you haven't installed Java (or you don't want to install it), then set the second variable like this:

export KERL_CONFIGURE_OPTIONS="--disable-hipe --without-javac --with-ssl=$(brew --prefix openssl)"

Install erlang

Now you can install the erlang version you need. In my case, I was needing to install the specific version 20.3.8.7.

asdf install erlang 20.3.8.7

I hope this method also work for you 😉.

Source link

I found the solution to my problem in this comment.

Discussion

markdown guide