Report this

What is the reason for this report?

Rails.service (code=exited, status=1/FAILURE) / BAD GATEWAY 502 when starting

Posted on April 12, 2021

I created a rails 6 droplet (ubuntu 20.04) and deployed my app but I can’t get it to run

I’ve edited /etc/nginx/sites-available/rails to:

root /home/my_app/public;

nano /etc/systemd/system/rails.service to:

WorkingDirectory=/home/my_app

When I run systemctl status rails it shows

● rails.service - ExampleApp
     Loaded: loaded (/etc/systemd/system/rails.service; enabled; vendor preset: enabled)
     Active: activating (auto-restart) (Result: exit-code) since Mon 2021-04-12 09:07:40 UTC; 2s ago
    Process: 60004 ExecStart=/bin/bash -lc bundle exec puma (code=exited, status=1/FAILURE)
   Main PID: 60004 (code=exited, status=1/FAILURE)

Nginx seems to be running, I’ve done daemon-reload, restarted nginx/rails.service

I’m not sure where to go from here

Any help would be appreciated!

The developer cloud

Scale up as you grow — whether you're running one virtual machine or ten thousand.

Start building today

From GPU-powered inference and Kubernetes to managed databases and storage, get everything you need to build, scale, and deploy intelligent applications.