cjm2671
cjm2671

Reputation: 19496

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

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?

Upvotes: 2

Views: 451

Answers (2)

Adam Millerchip
Adam Millerchip

Reputation: 23147

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.

Upvotes: 1

Aleksei Matiushkin
Aleksei Matiushkin

Reputation: 121010

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.

Upvotes: 5

Related Questions