sudo stdout:unicorn_appname_production:无法识别的服务
sudo stdout: unicorn_appname_production: unrecognized service
我有一个 ubuntu 服务器,带有 nginx、rails、ruby、unicorn 和 capistrano,我已经设置好了,当我 运行
cap production deploy:check
但是当我 运行
cap production deploy
我收到这个错误:
sudo stdout: unicorn_frank_production: unrecognized service
失败运行宁
/usr/bin/env sudo service unicorn_appname_production restart
而且我认为问题是最后一个“_production”,因为当我只是 运行 命令时
/usr/bin/env sudo service unicorn_appname restart
效果很好,但我不知道如何更改 capistranos 命令,因此非常感谢任何对此问题的帮助!
看起来 capistrano/unicorn_nginx
将其 unicorn_service
变量默认为 "unicorn_#{fetch(:application)}_#{fetch(:stage)}"
形式,如 https://github.com/capistrano-plugins/capistrano-unicorn-nginx/blob/master/lib/capistrano/tasks/unicorn.rake#L9
中所示
如果在您的 deploy.rb
中,您添加了:
set :unicorn_service, -> { "unicorn_#{fetch(:application)}" }
这应该能达到您的预期。
希望对您有所帮助!
我有一个 ubuntu 服务器,带有 nginx、rails、ruby、unicorn 和 capistrano,我已经设置好了,当我 运行
cap production deploy:check
但是当我 运行
cap production deploy
我收到这个错误:
sudo stdout: unicorn_frank_production: unrecognized service
失败运行宁
/usr/bin/env sudo service unicorn_appname_production restart
而且我认为问题是最后一个“_production”,因为当我只是 运行 命令时
/usr/bin/env sudo service unicorn_appname restart
效果很好,但我不知道如何更改 capistranos 命令,因此非常感谢任何对此问题的帮助!
看起来 capistrano/unicorn_nginx
将其 unicorn_service
变量默认为 "unicorn_#{fetch(:application)}_#{fetch(:stage)}"
形式,如 https://github.com/capistrano-plugins/capistrano-unicorn-nginx/blob/master/lib/capistrano/tasks/unicorn.rake#L9
如果在您的 deploy.rb
中,您添加了:
set :unicorn_service, -> { "unicorn_#{fetch(:application)}" }
这应该能达到您的预期。
希望对您有所帮助!