How do I get Ruby on Rails 5.2 to work with Nginx?

December 30, 2018 1.4k views
Ruby on Rails Nginx MySQL Ubuntu 18.04

I have tried basically everything to get my website Duelingpets to work with the new version of rails but each time it is continously failing. I tried to get it working on Apache but it kept displaying index of / instead. I tried to get it working with nginx on its own but it only displayed the nginx welcome screen instead of ruby. I have tried nginx with passenger and that was equally a failure as well.

What am I doing wrong and why does this continue to not work?
I have followed all the digital ocean tutorial steps but none of them seem to actually fix things. I have yet to get an answer or solutions to this problem and I been creating several different droplets just to find out how to get it to work. Why is it that Rails 5.2 plays perfectly well with my linux laptop but if I try to get it working with an ubuntu server on digital ocean it completely fails? Why????????

I am kind of at a loss as to why this is happening.
Can someone please help me to solve this issue as I want to have my site up and running on the newer version without having to rely on my older version.

Here are the guides I used for the work:

3 Answers

It reads like you’ve had many stabs at this and are fed up with how things are going. But some things require a closer look to get them ironed out. Why don’t you set things up per the tutorial with your Rails app and I’ll take a look at whatever issue you’re still having.


You need to edit the rails.service file to set the ‘default’ site

Description=ExampleApp <– change this to Duelingpets

WorkingDirectory=/home/rails/example/ <– change this to the new path
ExecStart=/bin/bash -lc 'bundle exec puma’


Thanks, that worked for me!

Have another answer? Share your knowledge.

You can type !ref in this text area to quickly search our full set of tutorials, documentation & marketplace offerings and insert the link!