My stack:
I have followed this guide: https://www.digitalocean.com/community/tutorials/how-to-deploy-a-rails-app-with-puma-and-nginx-on-ubuntu-14-04
The issue (nginx.log):
2015/09/30 12:40:32 [crit] 10291#0: *33 connect() to
unix:///usr/share/nginx/html/projectbox/shared/sockets/puma.sock failed
(2: No such file or directory) while
connecting to upstream, client: 192.168.33.1, server: ticketbox.local,
request: "GET / HTTP/1.1", upstream:
"http://unix:///usr/share/nginx/html/projectbox/shared/sockets/puma.sock:/",
host: "192.168.33.15"
`
If I execute rails s then it runs ok with Puma (says in the header).
I have checked:
Things I've witnessed:
Any ideas will be appreciated. It's my first attempt going from passenger to Puma which has become quite popular lately.
EDIT (config/puma.rb):
# Change to match your CPU core count
workers 1
# Min and Max threads per worker
threads 1, 6
# Default to production
rails_env = ENV['RAILS_ENV'] || "development"
environment rails_env
# Set up socket location
bind "unix://usr/share/nginx/html/projectbox/shared/sockets/puma.sock"
# Logging
stdout_redirect "/usr/share/nginx/html/projectbox/shared/log/puma.stdout.log", "/usr/share/nginx/html/projectbox/shared/log/puma.stderr.log", true
# Set master PID and state locations
pidfile "/usr/share/nginx/html/projectbox/shared/pids/puma.pid"
state_path "/usr/share/nginx/html/projectbox/shared/pids/puma.state"
activate_control_app
on_worker_boot do
require "active_record"
ActiveRecord::Base.connection.disconnect! rescue ActiveRecord::ConnectionNotEstablished
ActiveRecord::Base.establish_connection(YAML.load_file("/usr/share/nginx/html/projectbox/shared/config/database.yml")[rails_env])
end
When I enter puma -C config/puma.rb I get the same error. I also tried with sudo puma -b unix:///var/run/puma.sock and it started fine. Then with sudo puma -b unix:///usr/share/nginx/html/projectbox/shared/sockets/puma.sock and the error re-appeared. Any ideas will be appreciated.
Looks like Puma can't store a .sock file on a Virtual Box Shared Folder
via http://stackoverflow.com/questions/16388342/unicorn-fails-to-start-on-vagrant-box-due-to-errnoeperm
Most helpful comment
Looks like Puma can't store a .sock file on a Virtual Box Shared Folder
via http://stackoverflow.com/questions/16388342/unicorn-fails-to-start-on-vagrant-box-due-to-errnoeperm