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

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

This textbox defaults to using Markdown to format your answer.
You can type !ref in this text area to quickly search our full set of tutorials, documentation & marketplace offerings and insert the link!
These answers are provided by our Community. If you find them useful, show some love by clicking the heart. If you run into issues leave a comment, or add your own answer to help others.
Accepted Answer
Try seeing the output of
tail -f /var/log/syslog
Take a look if it shows: " Environment: development"… somewhere in the Puma output.
I was able to add any Environment Variable I needed in the file: /etc/systemd/system/rails.service using the format
[Service]
Type=simple
Environment="One=1" "Three=3"
Environment="Two=2"
Environment="Four=4"
I achieved removal the 5XX Server Error after affected services were restarted and systemctl daemon-reload used. So add-to-that:
systemctl restart nginx
systemctl restart rails
(…if not a full reboot).
In actuality, mine config turned out to be more like:
Environment="RAILS_ENV=production"
Environment="RAILS_MASTER_KEY=blah1234" #This is a Rails >v5.2 feature
Environment="RAILS_DATABASE_PASSWORD=12341234etc..."
Some more thoughts: A point of consumption for me is confusing ENV Vars, particularly if whether they are being set, or benignly stored in /root/.passwords.digitalocean.or.something
The /root/.dot-file location seems to indeed be benign, (but also a good place to copy the above-needed environment variables from.)
I will research if there is a more appropriate place for these environment settings I describe in this post. So, if you have info, please share.
referenced: https://unix.stackexchange.com/questions/455261/how-to-set-environmental-variable-in-systemd-service
Hi,
I’m facing the same issue with my server (same config as yours). While I haven’t found any solutions yet, I noticed that their original setup does not work either. When you create a new droplet and try accessing the url (droplet’s IP), it shows a NGINX page, not at all a Rails page. Also, if you take a look at their /home/rails/example app, it’s just an empty shell, there’s not even a view to be render. With Puma, NGINX should normally implement an upstream which is not present in /etc/nginx/sites-enabled/rails.
Is there a member of Digitalocean team that could help us understand this ? What’s the point of a one-click app if the setup is not working properly ? Not blaming you guys (you are doing an amazing work), just trying to understand.
I’ll keep you posted if I found any clues, will try to set this up as if the server was a fresh install without Rails/Ruby/Puma.
I’ve ran into the same roadblock. I get 502 bad gateway and I can’t seem to get Puma to serve the app (even if I run it from the terminal and keep it running there). Any luck anyone, or @digitalocean ?
Thank you,