How can I make sure distillery includes Erlang inets in the release?

400 views Asked by At

My application, when trying to run a release, has this fatal issue:

** (MatchError) no match of right hand side value: {:error, {:inets, {'no such file or directory', 'inets.app'}}}

It works fine when running it with mix on my localhost, however the distillery 2 release has this issue.

I installed erlang-inets ubuntu package from the erlang solutions repo and did another mix release, but that didn't seem to fix it.

What am I missing?

2

There are 2 answers

2
Aleksei Matiushkin On BEST ANSWER

You need to instruct mix to include inets OTP application into the release. In your mix.exs:

def application do
  [
    mod: {MyApp, []},
    ...
    applications: [:logger, ..., :inets, ...]
  ]
end

Sidenote: erlang-inets has nothing to do with the issue.

0
Adam Millerchip On

I just ran into this on a freshly-generated Phoenix 1.7 project, but it was a symptom of trying to run a dev release, when really I should have produced a prod release:

MIX_ENV=prod mix release

With the production build, :inets was not required.