【问题标题】:Puma .state file彪马 .state 文件
【发布时间】:2012-10-24 22:10:04
【问题描述】:

我正在尝试使用 Capistrano 部署带有 puma 的 Rails 应用程序。在部署结束时它会尝试运行

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

失败了

undefined method `has_key?' for false:FalseClass. 

我只是为puma.state 创建了一个空文件。我的问题是这个文件到底是什么,里面应该有什么?

【问题讨论】:

    标签: ruby-on-rails ruby ruby-on-rails-3 puma


    【解决方案1】:

    Puma 有一个状态文件,记录了进程的 PID。如果你是第一次部署,你应该删除 .state 文件,然后做一个

    cap deploy:cold

    或者,您可以使用类似的方法手动启动 puma

    cap puma:start

    这将启动进程并创建一个有效的状态文件。这是我在 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
    

    【讨论】:

      猜你喜欢
      • 2015-01-25
      • 2014-03-12
      • 1970-01-01
      • 1970-01-01
      • 1970-01-01
      • 1970-01-01
      • 2021-02-20
      • 2015-09-26
      • 2014-07-12
      相关资源
      最近更新 更多