当执行 bundle exec cap production puma:start 这行命令时出现
贴一下我项目里相关的配置:
deploy.rb
set :bundle_bins, %w(gem rake rails sidekiq sidekiqctl)
set :puma_rackup, -> { File.join(current_path, 'config.ru') }
set :puma_state, -> { "#{shared_path}/tmp/pids/puma.state" }
set :puma_pid, -> { "#{shared_path}/tmp/pids/puma.pid" }
set :puma_bind, -> { "unix://#{shared_path}/tmp/sockets/puma.sock" }
set :puma_conf, -> { "#{shared_path}/puma.rb" }
set :puma_access_log, -> { "#{shared_path}/log/puma.log" }
set :puma_error_log, -> { "#{shared_path}/log/puma.err.log" }
set :puma_role, :app
set :puma_env, -> { fetch(:rack_env, fetch(:rails_env, 'production')) }
set :puma_threads, [4, 16]
set :puma_workers, 4
set :puma_worker_timeout, 30
set :puma_init_active_record, true
set :puma_preload_app, true
set :puma_prune_bundler, true
namespace :puma do
desc 'Create Directories for Puma Pids and Socket'
task :make_dirs do
on roles(:app) do
execute "mkdir #{shared_path}/tmp/sockets -p"
execute "mkdir #{shared_path}/tmp/pids -p"
end
end
before :start, :make_dirs
end
Capfile
require 'capistrano/rvm'
require 'capistrano/bundler'
require 'capistrano/rails/assets'
require 'capistrano/rails/migrations'
require 'capistrano/scm/git'
install_plugin Capistrano::SCM::Git
# Plugins
require 'capistrano/safe_deploy_to'
require 'capistrano/puma'
require 'capistrano/puma/nginx'
require 'capistrano/faster_assets'
require 'capistrano/sidekiq'
require 'sshkit/sudo'
你可以对照检查一下