如何设置puma启动服务器启动/重启与capistrano?

时间:2016-05-26 08:05:29

标签: ruby-on-rails capistrano3 puma

我正在浏览puma upstart script并试图在我的服务器上进行设置。但是,经过一些试验和错误,我意识到我不应该手动执行此操作,而我的部署脚本即 capistrano应该为我这样做。

我谷歌这个,但除了capistrano-puma上的2行之外,我没有多少:

  

对于丛林任务(测试版),存在以下选项:

set :puma_jungle_conf, '/etc/puma.conf'
set :puma_run_path, '/usr/local/bin/run-puma'

我不知道如何使用它并让capistrano这样做而不是我手动执行它。

到目前为止完成的工作:

我关注了这个博客 - Deploying a Rails App on Ubuntu 14.04 with Capistrano, Nginx, and Puma,它就像一个魅力,除了,如果我重新启动服务器(或美洲狮流程),我必须记住运行cap production puma:restart死了,我得到了云观察警报。)

official docs之后,我制作了配置文件/etc/puma.conf

/home/deploy/apps/<app_name>/current

但无法找到puma.rb - 当然,puma.rb位于

<app_name>/shared/puma.rb

而不是

<app_name>/current/config/puma.rb

我在日志中遇到的实际错误:

/home/deploy/apps/voggle/shared/bundle/ruby/2.2.0/gems/puma-3.4.0/lib/puma/dsl.rb:26:in `read': No such file or directory @ rb_sysopen - config/puma.rb (Errno::ENOENT)
    from /home/deploy/apps/voggle/shared/bundle/ruby/2.2.0/gems/puma-3.4.0/lib/puma/dsl.rb:26:in `_load_from'
    from /home/deploy/apps/voggle/shared/bundle/ruby/2.2.0/gems/puma-3.4.0/lib/puma/dsl.rb:9:in `load'
    from /home/deploy/apps/voggle/shared/bundle/ruby/2.2.0/gems/puma-3.4.0/lib/puma/configuration.rb:204:in `block in load'
    from /home/deploy/apps/voggle/shared/bundle/ruby/2.2.0/gems/puma-3.4.0/lib/puma/configuration.rb:201:in `each'
    from /home/deploy/apps/voggle/shared/bundle/ruby/2.2.0/gems/puma-3.4.0/lib/puma/configuration.rb:201:in `load'
    from /home/deploy/apps/voggle/shared/bundle/ruby/2.2.0/gems/puma-3.4.0/lib/puma/launcher.rb:62:in `initialize'
    from /home/deploy/apps/voggle/shared/bundle/ruby/2.2.0/gems/puma-3.4.0/lib/puma/cli.rb:65:in `new'
    from /home/deploy/apps/voggle/shared/bundle/ruby/2.2.0/gems/puma-3.4.0/lib/puma/cli.rb:65:in `initialize'
    from /home/deploy/apps/voggle/shared/bundle/ruby/2.2.0/gems/puma-3.4.0/bin/puma:8:in `new'
    from /home/deploy/apps/voggle/shared/bundle/ruby/2.2.0/gems/puma-3.4.0/bin/puma:8:in `<top (required)>'
    from /home/deploy/apps/voggle/shared/bundle/ruby/2.2.0/bin/puma:23:in `load'
    from /home/deploy/apps/voggle/shared/bundle/ruby/2.2.0/bin/puma:23:in `<main>'

0 个答案:

没有答案