Closed
Description
When git push production master
and then visit url, it shows
function Phoenix.LiveReloader.call/2 is undefined (module Phoenix.LiveReloader is not available)
seems it uses phoenix_live_reload module which is only for dev.
remote: $ mix release --upgrade --upfrom=0.0.1479980159 --warnings-as-errors --env=prod (/root/starsoul)
remote: ==> Assembling release..
remote: ==> Building release starsoul:0.0.1479988632 using environment prod
remote: ==> Including ERTS 8.1 from /usr/lib/erlang/erts-8.1
remote: ==> Generated .appup for starsoul 0.0.1479980159 -> 0.0.1479988632
remote: ==> Relup successfully created
remote: ==> Packaging release..
remote: ==> Release successfully built!
remote: You can run it in one of the following ways:
remote: Interactive: rel/starsoul/bin/starsoul console
remote: Foreground: rel/starsoul/bin/starsoul foreground
remote: Daemon: rel/starsoul/bin/starsoul start
remote: $ service starsoul upgrade 0.0.1479988632
remote: Release 0.0.1479988632 not found, attempting to unpack releases/0.0.1479988632/starsoul.tar.gz
remote: Unpacked successfully: "0.0.1479988632"
remote: Installed Release: 0.0.1479988632
remote: Made release permanent: "0.0.1479988632"
To root@106.14.40.86:starsoul
3154393..723ea37 master -> master
How to solve this problem? Where did I miss? Thanks a lot!
Activity
loongmxbt commentedon Nov 24, 2016
in
proj_name/rel/config.exs
, changedefault_environment
to:prod
and runmix gatling.deploy proj_name
.Seems when upgrade it uses the rel/config default environment setup, but first deploy will build prod.
PS:
After modifying rel/config.exs, upgrade still uses dev causes error, but deploy uses prod works fine, what did I do wrong.
Need to do
service proj_name stop
andservice proj_name start
mrmicahcooper commentedon Dec 8, 2016
Hey @loongmxbt, what I typically do on the production server is globally set the
MIX_ENV
variable toprod
Here is a link to do this in the docs: https://github.com/hashrocket/gatling#deploying-your-app
dennisreimann commentedon Dec 19, 2016
I came across this too. For me the root cause of this is the sudo security policy that leads to a fresh environment for commands that run via sudo. I've added the necessary
--preserve-env
statements and hints with this commit: 17ca79floongmxbt commentedon Jan 9, 2017
We should deploy the app via a sudo user instead of the root user. Check den's guide!