0

我正在尝试使用 capistrano 3 进行部署,在 centos 6.5 上使用 nginx-unicorn。我能够运行 cap production deploy,然后 ssh 进入服务器并手动重新启动它。

我尝试包含 gem - https://github.com/kalys/capistrano-nginx-unicorn - 以自动重新启动 unicorn 和 nginx,但在尝试将 unicorn 作为服务重新启动时失败,运行此命令

/usr/bin/env sudo service unicorn_app_name_production stop
*service does not exist*

我在 unicorn 手动运行时检查了服务并且它不在其中,我通常使用此命令启动它

unicorn_rails -c config/unicorn.rb -E production -D

我使用本教程设置服务器 - https://www.digitalocean.com/community/tutorials/how-to-deploy-rails-apps-using-unicorn-and-nginx-on-centos-6-5

有什么帮助吗?

4

1 回答 1

0

您可以在类似的 gem 上检查此问题(capistrano-unicorn-nginx 基本上是 kalys/capistrano-nginx-unicorn 的改进分支)。免责声明:我目前维护该宝石。

核心问题是这两个 gem 都经过测试可以在 Ubuntu(而不是 CentOS)上运行,因此它们使用的是 Ubuntu 特性(目录等)。

我建议分叉您当前正在使用的 gem,并根据您的需要手动调整任务。例如,您可能需要更改设置,以便任务使用可在 centos 上运行的命令。

如果您设法完成这项工作,我将感谢您在此问题中留下反馈,因为它将帮助我最终为 Ubuntu、CentOS 和其他发行版制定解决方案。

于 2014-11-16T20:58:30.303 回答