Mix.Project missing in Elixir/Phoenix prod release

Am having an issue with Mix.Project being missing in an Elixir/Phoenix prod release - it is needed for a multitenant migration - and is called in Ecto… Any ideas why this would be missing in a release??

What am doing wrong - am using Edeliver/distillery to do the release/deploy


Error on the remote_console on the prod instance

iex(present_me@> Apartmentex.new_tenant(Repo, foo.id)
** (UndefinedFunctionError) function Mix.Project.deps_paths/0 is undefined (module Mix.Project is not available)
(ecto) lib/mix/ecto.ex:172: Mix.Ecto.source_repo_priv/1

Mix is not available in production on purpose. It is a build tool and not meant to give you information during runtime of your project.

If you really have to, you can include :mix in :extra_dependencies, but it will probably not work as you expect when you are in a distillery release, so I think it is best to find another way to implement the feature you need not using or relying on mix.

1 Like

Thanks the issue was in the apartmentex library and it has been patched… problem solved :slight_smile: