Reputation: 1
I'm looking for advice on how to deploy and run an elixir/phoenix program on Windows.
I've used Distillery, however, it worked with mix release
, but there are no commands available for command prompt. Every suggested command such as
_build/dev.../<program> console
produces the error not a recognized internal or external command
.
I've used exrm
as well, however, even after modifying the .bat
files to remove the unwanted //
in the path, it produces a kernel PID terminated
error in the erlang dump file.
VERSION:
The .bat's edited were:
<app>/rel/<app>/releases/version/app.bat and
<app>/rel/<app>/bin/app.bat
This was because it was trying to execute:
<app>/rel/<app>/releases//app.bat
instead of the above. (the fix was found on here)
This worked, program executed but throws error:
kernel PID Terminated (application controller) failed to start child 'elixir.helloworld.endpoint'
Thanks for the help so far, apologies as it's my first time doing any of this part.
note: Windows 10 with exrm
program runs normally with mix phoenix.server
Has anyone got a step by step to getting an elixir program or service to start on Windows?
Edit: getting warning during mix release
:
variable deps does not exist and is being expanded to deps()
And during trying to start:
failed to open file <app>/rel/<app>releases/version/conform
Edited <app>/rel/<app>/bin/app.bat
:
added ""
to %start_erl%
@set start_erl=%release_root_dir%\releases\start_erl.data
@for /f "delims=" %%i in ('type "%start_erl%"') do
@(set start_erl_data=%%i)
Edited <app>/rel/<app>/releases/version/app.bat
:
added ""
to %start_erl%
:: Discover the release root directory from the directory of this script
@set script_dir=%~dp0
@for %%A in ("%script_dir%\..\..") do @(set release_root_dir=%%~fA)
@set start_erl=%release_root_dir%\releases\start_erl.data
@for /f "delims=" %%i in ('type "%start_erl%"') do
@(set start_erl_data=%%i)
Added ""
to %werl%
:: Start a console
:console
@call :generate_config
@start "%rel_name% console" "%werl%" -config "%sys_config%" ^
-boot "%boot_script%" -boot_var ERTS_LIB_DIR "%erts_dir%"/lib ^
-env ERL_LIBS "%release_root_dir%"/lib ^
-pa "%release_root_dir%"/lib "%release_root_dir%"/lib/consolidated ^
-args_file "%vm_args%" ^
-user Elixir.IEx.CLI -extra --no-halt +iex
Upvotes: 0
Views: 1679
Reputation: 15343
A few more suggestions:
:observer.start()
Within observer, select File->Examine Crashdump from the menu. This may help you to figure out what's wrong as well. Upvotes: 1