Remson
Remson

Reputation: 73

rails 5 with puma with nginx systemd

right now i have a droplet in DO and experimenting in rails deployment procedures. I have a rails 5 in ubuntu 16 and have done all necessary procedures to be able to deploy my app except that currently stuck in nginx puma and systemd. I've already seen DO's tutorials but the problem is that they use upstart as the script for init. As a complete beginner in nginx and linux systems, i have no idea how to start my app with nginx. the last procedures i made was

*base from https://www.digitalocean.com/community/tutorials/how-to-deploy-a-rails-app-with-puma-and-nginx-on-ubuntu-14-04

this is the code of puma.service

[Unit]
Description=Puma HTTP Server
After=network.target

# Uncomment for socket activation (see below)
# Requires=puma.socket

[Service]
Type=simple
User=(myUser)
WorkingDirectory=/home/(myUser)/apps/(appName)

# ExecStart=<WD>/sbin/puma -b tcp://0.0.0.0:9292 -b ssl://0.0.0.0:9293?key=key.pem&cert=cert.pem
# ExecStart=/usr/local/bin/bundle exec --keep-file-descriptors puma -e production
ExecStart=/usr/local/bin/puma -C /home/(myUser)/apps/(appName)/config/puma.rb

Restart=always

[Install]
WantedBy=multi-user.target

im having exit 203, check some things and found out /usr/local/bin/puma doesnt exist in my linux.

Can someone help my setting up a proper systemd service? i really have no experience in this and im not sure what to put at ExecStart

Upvotes: 4

Views: 1629

Answers (1)

Mark Stosberg
Mark Stosberg

Reputation: 13381

Install puma if it is not already.

Use which puma to find out where puma is installed, then put that path on ExecStart= line.

Upvotes: 2

Related Questions