简体   繁体   English

Puma .state文件

[英]Puma .state file

I'm attempting to deploy my rails application w/ puma using Capistrano. 我正在尝试使用Capistrano部署我的rails应用程序w / puma。 Towards the end ofthe deployment it attempts to run 在部署结束时,它会尝试运行

bundle exec pumactl -S /home/deployer/production/shared/sockets/puma.state restart

which fails w/ 失败w /

undefined method `has_key?' for false:FalseClass. 

I have simply created a empty file for puma.state . 我只是为puma.state创建了一个空文件。 My question is what exactly is this file and what is supposed to be in it? 我的问题是这个文件到底是什么以及它应该是什么?

Puma has a state file that records the PID of the process. Puma有一个状态文件,记录进程的PID。 If you are deploying for the first time, you should delete the .state file, and do a 如果您是第一次部署,则应删除.state文件,然后执行

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: 这是我在capistrano的puma start命令:

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

声明:本站的技术帖子网页,遵循CC BY-SA 4.0协议,如果您需要转载,请注明本站网址或者原文地址。任何问题请咨询:yoyou2525@163.com.

 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM