2017-07-07 79 views
0

將我的ruby2.2.4升級到2.4.1我開始面臨這個問題。'帽子部署'不會重啓美洲獅,但'帽部署:重啓'確實

我的服務器在cap deploy之後會下降,但在工作之後會做cap deploy:restart

Capfile:

require 'capistrano/puma' 
require 'capistrano/puma/jungle' 

deploy.rb:

# ... 

namespace :deploy do 

    # after :restart, :clear_cache do 
    # on roles(:web), in: :groups, limit: 3, wait: 10 do 
    #  # Here we can do anything such as: 
    #  # within release_path do 
    #  # execute :rake, 'cache:clear' 
    #  # end 
    # end 
    # end 

    desc 'Initial Deploy' 
    task :initial do 
    on roles(:app) do 
     before 'deploy:restart', 'puma:start' 
     invoke 'deploy' 
    end 
    end 

    desc 'Restart application' 
    task :restart do 
    on roles(:app), in: :sequence, wait: 5 do 
     invoke 'puma:restart' 
    end 
    end 

    before :starting,  :check_revision 
    # after :finishing, :compile_assets 
    after :finishing, :cleanup 
    after :finishing, :restart 

    # https://github.com/airbrake/airbrake#capistrano 
    after :finished, 'airbrake:deploy' 
end 

如何診斷問題將是巨大的,以及任何幫助。

回答

0

添加在Gemfile中的capistrano-puma寶石(跳過如果已經添加):

gem 'capistrano3-puma' , group: :development 

然後,安裝Capistrano::Puma插件通過添加以下行Capfile

install_plugin Capistrano::Puma 

這將包括所有必要的庫。

而且還讓你在deploy.rb文件設置如下彪馬配置:

set :application,  'test-app' 
... 
... 
set :puma_bind,  "unix://#{shared_path}/tmp/sockets/#{fetch(:application)}-puma.sock" 
set :puma_state,  "#{shared_path}/tmp/pids/puma.state" 
set :puma_pid,  "#{shared_path}/tmp/pids/puma.pid" 

現在,嘗試部署你的應用程序。

相關問題