When I run bundle exec cap production puma:start
, I get the response that Puma has started successfully:
DEBUG [e4382d1e] * Pruning Bundler environment
DEBUG [e4382d1e]
DEBUG [e4382d1e] [2599] Puma starting in cluster mode...
DEBUG [e4382d1e]
DEBUG [e4382d1e] [2599] * Version 3.0.2 (ruby 2.2.1-p85), codename: Plethora of Penguin Pinatas
DEBUG [e4382d1e]
DEBUG [e4382d1e] [2599] * Min threads: 0, max threads: 16
DEBUG [e4382d1e]
DEBUG [e4382d1e] [2599] * Environment: staging
DEBUG [e4382d1e]
DEBUG [e4382d1e] [2599] * Process workers: 2
DEBUG [e4382d1e]
DEBUG [e4382d1e] [2599] * Phased restart available
DEBUG [e4382d1e]
DEBUG [e4382d1e] [2599] * Listening on tcp://0.0.0.0:9294
DEBUG [e4382d1e]
DEBUG [e4382d1e] [2599] * Daemonizing...
However,
bundle exec cap production puma:status
, it says that it cannot find file puma.pid
, therefore I think that Puma is not running, and it is not running,curl 0.0.0.0:9294
prints curl: (7) Failed to connect to 0.0.0.0 port 9294: Connection refused
,puma.pid
doesn't exist on the server, andHere's part of my Gemfile
:
gem 'puma'
group :development do
gem 'spring'
gem 'capistrano', '~> 3.0'
gem 'capistrano-rails'
gem 'capistrano-rvm'
gem 'capistrano3-puma'
end
Here's the Capfile
:
require 'capistrano/setup'
require 'capistrano/deploy'
require 'capistrano/rails'
require 'capistrano/rvm'
require 'capistrano/puma'
require 'capistrano/puma/nginx'
Here's the config/deploy/production.rb
:
server 'aws', user: 'my-username', roles: %w{app db web}
set :puma_bind, 'tcp://0.0.0.0:9294'
Any idea on:
Thanks.
Update: here's the repo with the Capistrano file. I've left with only Capistrano part (it's a fresh new project): https://github.com/flyfy1/CodeRead/
I just meet the same problem, and fixed it. When you use cap puma:start, you will see the following sentences in terminal:
puma:start
using conf file /your_web_app_path/shared/puma.rb
01 ~/.rvm/bin/rvm default do bundle exec puma -C /your_web_app_path/shared/puma.rb --daemon
execute bundle exec puma -C /your_web_app_path/shared/puma.rb
at your_web_app_path/current/, without the deamon option.
And it will tell you what's wrong with you application. For me, it told me that
No such file or directory @ rb_io_reopen - /my_web_app_path/shared/log/puma_access.log
Problem
Capistrano-Puma expects specific shared directories otherwise the server won't start.
These are:
tmp/pids
tmp/sockets log
Create shared directories in deploy.rb with:
set :linked_dirs, %w(tmp/pids tmp/sockets log)
cap puma:start says it is started but doesn't tell you it then fails. Verify with:
cap puma:status
or
ps -ax | grep puma
If you love us? You can donate to us via Paypal or buy me a coffee so we can maintain and grow! Thank you!
Donate Us With