Does anyone here have experience deploying to RHEL with something like edeliver? I am beyond stuck.
What is the specific problem are you stuck on?
Here’s my post about how to deploy Phoenix to Ubuntu 16.04 using edeliver and distillery: https://shovik.com/blog/6-deploying-phoenix-apps-for-rails-developers
There shouldn’t be very many differences for RHEL. The only differences would be in how you install Erlang, Elixir and Postgres on it. RHEL has different package manager and SELinux, but other than that it’s the same for what you’re trying to do.
I have everything installed. IEx and erl both work, but when I run mix edeliver build release production
I get:
-----> Cleaning generated files from last build
-----> Fetching / Updating dependencies
using mix to fetch and update deps
bash: line 10: mix: command not found
A remote command failed on:
my-user@my-ip
Output of the command is shown above and the command executed
on that host is printed below for debugging purposes:
FAILED with exit status 127:
[ -f ~/.profile ] && source ~/.profile
set -e
cd /home/avhana/edeliver/beacon/builds
if [ "mix" = "rebar" ]; then
echo "using rebar to fetch and update deps"
./rebar update-deps get-deps
elif [ "mix" = "mix" ]; then
echo "using mix to fetch and update deps"
if [ ! -f ~/.mix/rebar ] || [ ! -f ~/.mix/rebar3 ]; then
APP="beacon" MIX_ENV="prod" mix local.rebar --force
else
echo "rebar and rebar3 for mix was built already"
fi
APP="beacon" MIX_ENV="prod" mix local.hex --force
APP="beacon" MIX_ENV="prod" mix deps.get
fi
This means that Elixir and mix are not installed on that server. It looks like you’re trying to use it as a BUILD_HOST (edeliver), which requires Erlang, Elixir (which includes “mix”) to be installed first.
Use installation instructions here: http://elixir-lang.org/install.html#unix-and-unix-like. RHEL is similar to Fedora.
Once installed, make sure “mix” program works: SSH to your server and type “mix -v” to get its version.
I definitively have elixir and erlang installed. Running mix -v
on the server gives me:
Erlang/OTP 19 [erts-8.2] [source-fbd2db2] [64-bit] [smp:4:4] [async-threads:10] [hipe] [kernel-poll:false]
Mix 1.4.0
I’ll read the link and see if I missed anything.
*edit
I had to build elixir from source to get a recent version, but it works when I’m ssh’d in.
Hm, try running this in --verbose mode to see which commands it runs:
mix edeliver build release --verbose
Or even more detailed:
mix edeliver build release --debug
The latter one shows everything edeliver does on your server.
Edit: edeliver SSH’es to your server as a user you specified in .deliver/config. Is it the same user as you’re SSH’ing as manually? It is possible edeliver doesn’t get full environment as your user, it doesn’t load your ~/.profile and paths: “mix” may not be in your PATH.
I’ll spare you the full debug output, but it boils down to:
A remote command failed on:
my-user@my-ip
Output of the command is shown above and the command executed
on that host is printed below for debugging purposes:
FAILED with exit status 127:
[ -f ~/.profile ] && source ~/.profile
set -e
cd /home/avhana/edeliver/beacon/builds
if [ "mix" = "rebar" ]; then
echo "using rebar to fetch and update deps"
./rebar update-deps get-deps
elif [ "mix" = "mix" ]; then
echo "using mix to fetch and update deps"
if [ ! -f ~/.mix/rebar ] || [ ! -f ~/.mix/rebar3 ]; then
APP="beacon" MIX_ENV="prod" mix local.rebar --force
else
echo "rebar and rebar3 for mix was built already"
fi
APP="beacon" MIX_ENV="prod" mix local.hex --force
APP="beacon" MIX_ENV="prod" mix deps.get
fi
I don’t have a ~/.profile
and trying to create one and set env vars there didn’t work either.
Yeah, its the same user. I don’t have a ~/.profile
, but when I add one, I get basically the same error. Or a can’t find git error(127).
Would you be willing to do a screen share later today? I’m in US/Eastern time zone. I could do it at 9:30 PM… Maybe some brainstorming would help
I may have to rain-check I’m doing a work thing tonight and I’m not sure when it ends. Can I ping you on GH issues/slack/email perhaps tomorrow or sometime in the next few days? Its a greenfield project and I don’t have a super tight deploy deadline, so I don’t want to unnecessarily rush you.
No problem, tomorrow during the day would work - please ping me here on forum, I’ll get notified.
Awesome! Thanks, will do.
I’m free basically whenever today.
Let’s try this: https://appear.in/bewitching-turtle (requires Chrome plugin)
cool, I’ll hop on in a few minutes
I’m hanging out there whenever you’re free
I’m stuck in the same error. If you solved it, could you share how to it?
I have an internal guide that I can clean up and post soon
Try this gist out https://gist.github.com/Ch4s3/77f5946972f7677b0ab4e3a9d9e22729
I am stuck at the same problem. I saw your guide but I want to continue using asdf version manager. Did you guyz know root cause of this issue and any workaround?