2

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?

Adam Millerchip
  • 20,844
  • 5
  • 51
  • 74
cjm2671
  • 18,348
  • 31
  • 102
  • 161

2 Answers2

5

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.

Aleksei Matiushkin
  • 119,336
  • 10
  • 100
  • 160
  • what is the erlang-inets package for then? – cjm2671 Mar 11 '19 at 11:32
  • I worked out that it's getting stuck due to jose not compiling, trying to figure it out (question submitted here https://github.com/potatosalad/erlang-jose/issues/68) – cjm2671 Mar 11 '19 at 11:33
1

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.

Adam Millerchip
  • 20,844
  • 5
  • 51
  • 74