'Unknown option when running mix release

I've just upgraded Elixir from 1.7.4 to 1.10.4 on my build server and I'm getting this error:

** (Mix) Could not invoke task "release": 2 errors found!
--env : Unknown option
--no-tar : Unknown option

The command remained the same as before, which is:

MIX_ENV=prod mix release --env=prod --no-tar

When I try to run without these two flags the build works but I can't get the server running. These are the errors.

{"could not start kernel pid",application_controller,"error in config file \"/mokily/gerard/releases/222.38.10/sys.config\" (none): configuration file not found"}

could not start kernel pid (application_controller) (error in config file "/mokily/gerard/releases/222.38.10/sys.config" (none): configuration file not found)


Solution 1:[1]

  1. These flags are not needed for release. env is already specified by MIX_ENV=prod, tar won’t be built.
  2. Before issuing mix release one must prepare the source tree to release with mix release.init.

Sources

This article follows the attribution requirements of Stack Overflow and is licensed under CC BY-SA 3.0.

Source: Stack Overflow

Solution Source
Solution 1 Aleksei Matiushkin