I’ve been using erln8 for
years. My buddy Dave wrote it because
wanted a way of switching Erlang versions automatically when entering
a directory. It’s done that job well for me for years, but it seems to
be showing its age. There’s a v2 that never quite got
working, so I couldn’t rely on that.
SPOILER ALERT: I can!
I was using
curl to install
kerl, but Michael Coles dropped the hot tip that
kerl will install the completions for you for free!
let me know that as of
kerl will detect your homebrew
version of openssl all by itself!
We’re going to need one more tool to get that killer feature of
kerl is missing:
We’ll have to tell
kerl that we want git releases, because
gitbub/erlang/otp gets tagged way more than erlang.org gets releases,
so let’s just set up a
~/.kerlrc file now:
Let’s make sure those variables wind up in the ENV for everyone, we’ll
need them in scope for
I like this kind of stuff in my
~/.zshrc will also
At this point it probably makes sense to build at least two versions, so we can make sure everything switches up the way we want
Hope you didn’t take that advice about the coffee too seriously. Erlang builds aren’t the fastest, but hey maybe you made a cold brew… you probably had the time.
While you’re doing that, you can start getting
direnv ready to
go. I’m in
zsh, probably works the same in
bash, something weird
probably happens with
fish, which is why I stopped using it. Amazing
shell, until you need POSIX.
The command you need to insert direnv into your
We’ll want to add this cool helper function for
let’s do that now:
So, now we have
direnv installed and working. We’ve got two versions
erlang installed via
kerl. We’ve also set up a helper function
direnvrc, so now we’re pretty much in business.
now you can go into a project and create a
.envrc file that looks
AND THAT’S IT This dir will use
19.1.2 until you change this
Let’s make sure you have a default ERLANG ready to go when you’re anywhere else:
~/.profile, below the part where you
Why are we
ERLANG_VERSION anyway? Well, stay tunned for