Running mix deps.compile on a new phoenix project with exrm may result in the following warning:

===> Rebar3 detected a lock file from a newer version. It will be loaded in compatibility mode, but important information may be missing or lost. It is recommended to upgrade Rebar3.

I’m running MacOS Sierra and installed Elixir along with Erlang from homebrew.

For me, the solution was indeed to upgrade rebar3, but it was not obvious to me how to accomplish that, since the binary was not in my PATH and was not installed by me explicitly. After some digging I found that the rebar3 binary itself (called out elsewhere in the build output) has a local upgrade option:

$ /Users/jason/.mix/rebar3 --version
rebar 3.2.0 on Erlang/OTP 19 Erts 8.2
$ /Users/jason/.mix/rebar3 local upgrade
===> Extracting rebar3 libs to /Users/jason/.cache/rebar3/lib...
===> Writing rebar3 run script /Users/jason/.cache/rebar3/bin/rebar3...
===> Add to $PATH for use: export PATH=$PATH:/Users/jason/.cache/rebar3/bin
$ /Users/jason/.mix/rebar3 --version
rebar 3.2.0 on Erlang/OTP 19 Erts 8.2
$ ~/.cache/rebar3/bin/rebar3 --version
rebar 3.3.4 on Erlang/OTP 19 Erts 8.2

So, the “local upgrade” command placed the new binary safely elsewhere on the system, and offered an optional PATH entry for easy access. However something about my mix or hex configuration (presumably a default) is looking specifically in ~/.mix for rebar3, so to eliminate this warning I had to link it there as well.

Categories: Elixir

1 Comment

mizhi · April 22, 2017 at 5:51 pm

Ran across your blog while I was searching for a solution to this.

Turns out that there is a `mix` task that fixed it up for me:

`$ mix local.rebar`

Leave a Reply