目前運行Capistrano的部署:Capistrano的。因爲沒有服務器.... puma.state停止
環境: Capistrano 2.15.5
RAILS_ENV=uat cap deploy
2013-11-22 04:27:34 executing `puma:stop'
* no servers for "cd /home/ubuntu/fancied-server/current; bundle exec pumactl -S /home/ubuntu/fancied-server/shared/sockets/puma.state stop"
我Capistrano的:
require "capistrano"
set :rvm_ruby_string, :local # use the same ruby as used locally for deployment
set :rvm_autolibs_flag, "read-only" # more info: rvm help autolibs
before 'deploy:setup', 'rvm:install_rvm' # install RVM
before 'deploy:setup', 'rvm:install_ruby' # install Ruby and create gemset, OR:
if ENV['RAILS_ENV'] == 'uat'
# The address of the remote host on EC2 (the Public DNS address)
set :location, "54.252.151.190"
set :branch, "uat"
role :app, location
role :web, location
role :db, location, :primary => true
role :resque, location
role :rapns, location
#after 'deploy:stop', 'puma:stop'
#after 'deploy:start', 'puma:start'
#after 'deploy:restart', 'puma:restart'
# Ensure the tmp/sockets directory is created by the deploy:setup task and
# symlinked in by the deploy:update task. This is not handled by Capistrano
# v2 but is fixed in v3.
#shared_children.push('tmp/sockets')
_cset(:puma_cmd) { "#{fetch(:bundle_cmd, 'bundle')} exec puma" }
_cset(:pumactl_cmd) { "#{fetch(:bundle_cmd, 'bundle')} exec pumactl" }
_cset(:puma_state) { "#{shared_path}/sockets/puma.state" }
_cset(:puma_socket) { "unix://#{shared_path}/sockets/puma.sock" }
_cset(:puma_role) { :app }
end
namespace :deploy do
task :start, :roles => :web, :on_error => :continue do
if ENV['RAILS_ENV'] == 'uat'
if !puma.puma_pid_exists?
puma.start
else
puma.restart
end
else
run start_command
end
sleep 2
warmup_cache
end
....
namespace :puma do
desc 'Start puma'
task :start, :roles => lambda { fetch(:puma_role) }, :on_no_matching_servers => :continue, :on_error => :continue do
run "cd #{current_path} && #{fetch(:puma_cmd)} #{start_options}", :pty => false
end
desc 'Stop puma'
task :stop, :roles => lambda { fetch(:puma_role) }, :on_no_matching_servers => :continue, :on_error => :continue do
run "cd #{current_path}; #{fetch(:pumactl_cmd)} -S #{state_path} stop"
end
desc 'Restart puma'
task :restart, :roles => lambda { fetch(:puma_role) }, :on_no_matching_servers => :continue, :on_error => :continue do
run "cd #{current_path}; #{fetch(:pumactl_cmd)} -S #{state_path} restart"
end
end
所以問題是:我服務器設置正確嗎?或者如何設置服務器,所以它會停止對問題的糾正