Github nerves examples require erlang 19

hi all, for the nerves examples I can’t seem to install them because they require erlang 19

any idea how to update them so they support elixir 1.5.1 and erlang 20?

for hello_phoenix, I did change mix.exs to

 elixir: "~> 1.5.1",

[{:nerves, "~> 0.7.1", runtime: false}] ++

  {:nerves_network, "~> 0.3.0"},

On a Mac, I used “erlang@19” for erlang and I could not downgrade elixir to 1.4.1. So I return erlang back to 20 and kept elixir at 1.5.1

I originally went through the nerves installation instructions at Installation — nerves v1.9.1

Answering my own post here to save others time. I managed to get past this by using asdf.

remove brew installed elixir

brew rmtree elixir

get asdf

git clone ~/.asdf --branch v0.3.0
source ~/.asdf/
asdf plugin-add erlang
asdf plugin-add elixir
asdf install erlang 19.3 # lots of compiling
asdf install elixir 1.4.1

re-install nerves target dependencies because they need to be based upon 1.4.1/19.3

mix local.hex
mix local.rebar # saw 19:30:37.823 [error] GenServer #PID<0.114.0> terminating
mix archive.install
mix local.nerves

Managing Elixir and Erlang with ASDF-vm


Thanks for posting this!
I plan to get the examples updated to use new systems that support OTP 20 shortly, but it’s a good idea to start using a tool like asdf to manage your tool versions anyway because this is a recurring problem every time there’s a new major release of OTP. In fact, after the examples are updated, they will no longer work for people still using OTP 19, so it’s really best to be able to easily control the version you want to use for a given project like asdf allows using the asdf local erlang 20.0 command. This is due to the fact that Nerves requires that the version of OTP running on your computer is the same as the one running on the target platform, but the target has OTP built-in so that it can cross-compile the code for you.

1 Like