I'm attempting to deploy my rails application w/ puma using Capistrano. Towards the end ofthe deployment it attempts to run
bundle exec pumactl -S /home/deployer/production/shared/sockets/puma.state restart
which fails w/
undefined method `has_key?' for false:FalseClass.
I have simply created a empty file for puma.state
. My question is what exactly is this file and what is supposed to be in it?
Puma is a small library that provides a very fast and concurrent HTTP 1.1 server for Ruby web applications. It is designed for running Rack apps only.
Puma works in two main modes: cluster and single. In single mode, only one Puma process boots. In cluster mode, a master process is booted, which prepares (and may boot) the application and then uses the fork() system call to create one or more child processes. These child processes all listen to the same socket.
Puma is an HTTP web server derived from Mongrel and written by Evan Phoenix. It stresses speed and efficient use of memory.
Puma has a state file that records the PID of the process. If you are deploying for the first time, you should delete the .state file, and do a
cap deploy:cold
or, you can start puma manually using something like
cap puma:start
This will start the process and create a valid state file. Here is my puma start command in capistrano:
namespace :puma do
desc "Start the application"
task :start, :roles => :app, :except => { :no_release => true } do
run "cd #{current_path} && RAILS_ENV=#{rails_env} bundle exec puma -t 8:32 -b 'unix://#{shared_path}/sockets/puma.sock' -S #{shared_path}/sockets/puma.state --control 'unix://#{shared_path}/sockets/pumactl.sock' >> #{shared_path}/log/puma-#{rails_env}.log 2>&1 &", :pty => false
end
after "deploy:start", "puma:start"
end
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