Report this

What is the reason for this report?

Starting Rails Server in a different project directory

Posted on September 26, 2018

I’m using Digital Ocean’s One-Click Install Apps feature to simplify starting a VM with Ruby on Rails pre-installed.

Right off the bat, it generates \home\rails\rails_project as a starter Ruby on Rails web application to verify everything is running like normal.

However, I want to build a separate Ruby on Rails web application project within the home directory and initialize rails server there instead of the pre-configured \home\rails\rails_project

I’ve edited /etc/nginx/sites-available/rails and /etc/unicorn.conf to point to my new project directory. I’ve also restarted nginx service, restarted unicorn service, but when I start rails server, I keep getting a 502 Bad Gateway or ‘This site can’t be reached’ error when I attempt development mode with :3000. I don’t have a problem when I restore to default values, bundle install in \home\rails\rails_project and start rails server there.

Is there a step I’m missing?



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.

I would check this:

  1. Ownership and permission of your new project directory (chown -R rails.rails)

  2. Check the unicorn log for clues (/var/log/unicorn/unicorn.log)

The developer cloud

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

Get started for free

Sign up and get $200 in credit for your first 60 days with DigitalOcean.*

*This promotional offer applies to new accounts only.