Starting Rails Server in a different project directory

September 26, 2018 618 views
Ruby on Rails One-Click Install Apps

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?

1 Answer

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)

Have another answer? Share your knowledge.