Report this

What is the reason for this report?

Rails/Nginx/Capistrano/Puma: (111: Connection refused) while connecting to upstream

Posted on June 8, 2016
kiym

By kiym

I followed this guide on Digital Ocean to set up my server with my Rails project. I’m still fairly new to Puma and Nginx, so I don’t have the confidence to touch anything in the configuration files.

I’m getting this error:

2016/06/06 20:14:02 [error] 907#0: *1 connect() to unix:///home/user/apps/appname/shared/tmp/sockets/appname-puma.sock failed (111: Connection refused) while connecting to upstream, client: 50.100.162.19, server: , request: "GET / HTTP/1.1", upstream: "http://unix:///home/user/apps/appname/shared/tmp/sockets/appname-puma.sock:/", host: "appname.com"

(here it is with manually added newlines for your convenience)

2016/06/06 20:14:02 [error] 907#0: *1 connect() to
unix:///home/user/apps/appname/shared/tmp/sockets/appname-puma.sock failed
(111: Connection refused) while connecting to upstream, client: 
50.100.162.19, server: , request: "GET / HTTP/1.1", upstream: 
"http://unix:///home/user/apps/appname/shared/tmp/sockets/appname-
puma.sock:/", host: "appname.com"


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.

To solve this issue I had to navigate to my “app”. Then I performed a “rails s” command which starts the Puma server, if it is in your* Rails app Gemfile “gem puma*”. I had connection errors until I cleared up the Local puma errors. Also if you have a database in your Rails app run “rake db:migrate” or if you have a seed run “rake db:seed”

Oh my god, I can’t believe I didn’t reply to this. I obviously found a solution since then.

Sometimes I need to reboot the droplet with sudo reboot, other times (usually after I commit), I have to restart the server. I use Capistrano, so I just had to do cap production deploy:restart.

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.