2017-07-07 81 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" 

现在,尝试部署你的应用程序。

相关问题