Distillery on windows doesn't build tar.gz

Hey how could i build my elixir phoenix app on my windows laptop to get a tar.gz ot deploy it on my vps?
Even though I am using Ubuntu subsystem and building there it still produces a .bat.

Thank you

Which Elixir are you using, /usr/bin or “/mnt/c/Program Files (x86)/Elixir/bin”? From WSL, you can actually run the Windows one. And I believe you should run distillery on the same OS as the deployment target…

how can i check? i have elixir on both installed, because i need it on widows for the formatter…
I want to build for linux sysetm, I know i can just build on the server, but I would like to know if is it poosible.


what does ‘which elixir’ give back to you?

From my point of view, a clean way to build would be in a Docker container, which resembles the destination OS…

Like here https://github.com/chgeuer/elixir_phoenix_docker/blob/master/Dockerfile

1 Like

/usr/local/bin/elixir this one

Please use a dedicated host, a dedicated VM or a properly isolated container to build for a linux target, this list was given in order of preference. WSL is a crudge, no solution.

Especially make sure, that neither deps, nor _build from your windows machine are allowed to slip through to the build host, this might destroy your build, this is especially true if beam files from the windows host are taken for the linux build.

Also, an advice I hear very often, do not mix and match Windows and WSL. If you edit with a windows editor and compile from WSL, this is known to give problems, not only for elixir but many other languages. I’ve heard this advice even for LaTeX…

1 Like

Got it thanks!

Actually when i build the project and run it with either foreground or start, what port will it run on?

Whatever you have configured.

well i left it on default and the dev is on 4000 and the prod is on 8888 but none of the is responding, also when i run wit foreground should it write something in the console
in console mode it shows this iex(user_restfulapi_phx@>

  1. What is your MIX_ENV when building the release?
  2. In the corresponding config what is the port and the IP you bind to?
  3. What does netstat -lnpt tell you about your application?
  4. Are you testing from the same host or from a different one?
  5. Have you checked your firewall(s)? (especially when testing from a different host)

dev I think, i build with mix release

in dev.exs it has port 4000, i never set ip, when i run the app normally it is localhost, i didnt change the configs, i used the default ones.

(No info could be read for "-p": geteuid()=1000 but you should be root.)
Active Internet connections (only servers)
Proto Recv-Q Send-Q Local Address           Foreign Address         State       PID/Program name

same host as it was built on, i build it and i want to run it

did not check my firewall, what too look for?

Also which way shoul it be run in? console foreground or start?

There is nothing listening as it seems.

Are you building the release and starting it from the very same host under the very same environment? When doying it in foreground, do you see any other messages? What are your versions of erlang, elixir and phoenix? Do you have a :mod key in the list returned by the mix.exss application function?

Can you tell more about how you actually build the application?

yes i do
no it doesn’t show anything in foreground.

Erlang/OTP 21 [erts-10.0] [source] [64-bit] [smp:4:4] [ds:4:4:10] [async-threads:1] [hipe]

IEx 1.6.6 (compiled with OTP 19)

Phoenix v1.3.3

i have a mode key : mod: {UserRestfulapiPhx.Application, []}

I followd the official guide: https://hexdocs.pm/distillery/walkthrough.html#adding-distillery-to-your-project

What exact command do you use to build your release and what is the output you get during build? Please make sure to do a clean build my removing deps and _build first. (of course you need to mix deps.get again)

I am using the mix release command
the output is:

Generated user_restfulapi_phx app
==> Assembling release..
==> Building release user_restfulapi_phx:0.0.1 using environment dev
==> One or more direct or transitive dependencies are missing from
    :applications or :included_applications, they will not be included
    in the release:


This can cause your application to fail at runtime. If you are sure
that this is not an issue, you may ignore this warning.

==> You have set dev_mode to true, skipping archival phase
==> Release successfully built!
    You can run it in one of the following ways:
      Interactive: _build/dev/rel/user_restfulapi_phx/bin/user_restfulapi_phx console
      Foreground: _build/dev/rel/user_restfulapi_phx/bin/user_restfulapi_phx foreground
      Daemon: _build/dev/rel/user_restfulapi_phx/bin/user_restfulapi_phx start

What operating system is this and what filesystem is used? If there is windows or NTFS involved, please deactivate dev_mode and try again.

If that doesn’t change anything I’m out of ideas and @bitwalker or one of the many other forum mebers has to help.

i deactivated dev mode but the result is the same.
it is Ubuntu subsystem on windows, so Ubuntu file tree is used.

Haven’t I said that you shouldn’t use it? Haven’t you said you understood?

Please try again using a dedicated build host, a virtual machine or a docker container.

getting the same result on macos
nothing shows up after running it with foreground

1 Like

I’m having same exact issue right now on MacOS.

EDIT: For some reason it generates me a batch file. hmm.

1 Like