kiym
By:
kiym

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

June 8, 2016 1.1k views
Ruby on Rails Nginx Getting Started Ubuntu

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"
1 Answer

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"

Have another answer? Share your knowledge.