Closed PaoloLaurenti closed 5 years ago
It doesn't necessarily mean it is looking for a local installation - can you confirm what machine and OS you are building the release on and what machine and OS you are deploying to? This error may also occur when the build and target machines differ, and the bundled erl
cannot be used.
The OS of the building machine was Windows Server 2016. I tried to deploy the same release to another Windows Server 2016 machine and to a machine with Windows 10 Pro . The results were the same with both machines.
I had no problems with previous version of Distillery (1.5.2)
I was able to put in place a workaround in order to start the release on both machines. These are the changes I've done:
<app_name>/releases/<version>/libexec/win/erts.ps1
in this way
# Set up ERTS environment
if ($Env:ERTS_VSN -eq $null) {
# Update start_erl.data
$Env:ERTS_VSN = $erts_vsn
$Env:ROOTDIR = $rootdir
set-content -Path $Env:START_ERL_DATA -InputObject ("{0} {1}" -f $erts_vsn,$Env:REL_VSN)
} else {
$Env:ERTS_VSN = $erts_vsn
$Env:ROOTDIR = $Env:RELEASE_ROOT_DIR
}
$Env:ERTS_DIR = (join-path $Env:ROOTDIR ("erts-{0}" -f $Env:ERTS_VSN))
write-host $Env:ERTS_DIR
$Env:BINDIR = (join-path $Env:ERTS_DIR bin)
write-host $Env:BINDIR
$Env:ERTS_LIB_DIR = (resolve-path (join-path $Env:ERTS_DIR (join-path ".." lib)))
write-host $Env:ERTS_LIB_DIR
$Env:LD_LIBRARY_PATH = ("{0}:{1}" -f $Env:ERTS_LIB_DIR,$Env:LD_LIBRARY_PATH)
write-host $Env:LD_LIBRARY_PATH
$Env:EMU = "beam"
$Env:PROGNAME = "erl"
here you can see the diff with the script generated by distillery
erl.ini
inside <app_name>/erts-10.0.1/bin
Steps to reproduce
set include_erts: true
flag/release/bin/<app_name>.bat install
Unusable Erlang runtime system! This is likely due to being compiled for another system than the host is running
Description of issue
What are the expected results? The expected results are that all the commands exposed by the .bat file will use the bundled runtimes of Erlang and Elixir instead of looking for the installed ones.
What version of Distillery? 2.0.10
What OS, Erlang/Elixir versions are you seeing this issue on? Erlang 21.0.5 Elixir 1.7.2
If possible, also provide your
rel/config.exs
, as it is often my first troubleshooting question, and you'll save us both time :)use Mix.Releases.Config,
This sets the default release built by
mix release
For a full list of config options for both releases
and environments, visit https://hexdocs.pm/distillery/configuration.html
You may define one or more environments in this file,
an environment's settings will override those of a release
when building in that environment, this combination of release
and environment configuration is called a profile
environment :dev do
If you are running Phoenix, you should make sure that
server: true is set and the code reloader is disabled,
even in dev mode.
It is recommended that you build with MIX_ENV=prod and pass
the --env flag to Distillery explicitly if you want to use
dev mode.
set dev_mode: true set include_erts: true set cookie: :""
end
environment :prod do set include_erts: true set include_src: false plugin Releases.Plugin.LinkConfig end
You may define one or more releases in this file.
If you have not set a default release, or selected one
when running
mix release
, the first release in the filewill be used by default
release :marconi do set version: current_version(:marconi) set applications: [ :runtime_tools ] end