gpt4 book ai didi

ruby-on-rails - Capistrano-Puma 未启动 Puma 服务器

转载 作者:行者123 更新时间:2023-12-04 06:13:21 26 4
gpt4 key购买 nike

面临的问题

当我运行 bundle exec cap production puma:start 时,我得到 Puma 已成功启动的响应:

DEBUG [e4382d1e]    * Pruning Bundler environment
DEBUG [e4382d1e]
DEBUG [e4382d1e] [2599] Puma starting in cluster mode...
DEBUG [e4382d1e]
DEBUG [e4382d1e] [2599] * Version 3.0.2 (ruby 2.2.1-p85), codename: Plethora of Penguin Pinatas
DEBUG [e4382d1e]
DEBUG [e4382d1e] [2599] * Min threads: 0, max threads: 16
DEBUG [e4382d1e]
DEBUG [e4382d1e] [2599] * Environment: staging
DEBUG [e4382d1e]
DEBUG [e4382d1e] [2599] * Process workers: 2
DEBUG [e4382d1e]
DEBUG [e4382d1e] [2599] * Phased restart available
DEBUG [e4382d1e]
DEBUG [e4382d1e] [2599] * Listening on tcp://0.0.0.0:9294
DEBUG [e4382d1e]
DEBUG [e4382d1e] [2599] * Daemonizing...

然而,
  • 当我运行 bundle exec cap production puma:status 时,它​​说它找不到文件 puma.pid ,因此我认为 Puma 没有运行,它没有运行,
  • 在服务器上, curl 0.0.0.0:9294 打印 curl: (7) Failed to connect to 0.0.0.0 port 9294: Connection refused
  • 服务器上不存在 puma.pid 文件,并且
  • 如果我尝试在服务器上手动启动 Puma,它工作正常。

  • 我的设置信息

    这是我的 Gemfile 的一部分:
    gem 'puma'

    group :development do
    gem 'spring'
    gem 'capistrano', '~> 3.0'
    gem 'capistrano-rails'
    gem 'capistrano-rvm'
    gem 'capistrano3-puma'
    end

    这是 Capfile :
    require 'capistrano/setup'
    require 'capistrano/deploy'
    require 'capistrano/rails'
    require 'capistrano/rvm'
    require 'capistrano/puma'
    require 'capistrano/puma/nginx'

    这是 config/deploy/production.rb :
    server 'aws', user: 'my-username', roles: %w{app db web}
    set :puma_bind, 'tcp://0.0.0.0:9294'

    任何想法:
  • 问题的原因是什么?
  • 如何解决?

  • 谢谢。

    更新:这是带有 Capistrano 文件的 repo。我只留下了 Capistrano 部分(这是一个全新的项目): https://github.com/flyfy1/CodeRead/

    最佳答案

    我刚刚遇到了同样的问题,并修复了它。当你使用 cap puma:start 时,你会在终端看到如下语句:

     puma:start
    using conf file /your_web_app_path/shared/puma.rb
    01 ~/.rvm/bin/rvm default do bundle exec puma -C /your_web_app_path/shared/puma.rb --daemon

    在 your_web_app_path/current/执行 bundle exec puma -C /your_web_app_path/shared/puma.rb,不带守护程序选项。

    它会告诉你你的应用程序有什么问题。对我来说,它告诉我
     No such file or directory @ rb_io_reopen - /my_web_app_path/shared/log/puma_access.log 

    关于ruby-on-rails - Capistrano-Puma 未启动 Puma 服务器,我们在Stack Overflow上找到一个类似的问题: https://stackoverflow.com/questions/36327612/

    26 4 0
    Copyright 2021 - 2024 cfsdn All Rights Reserved 蜀ICP备2022000587号
    广告合作:1813099741@qq.com 6ren.com