Capistrano 3 Unicorn在最后一步开始返回一个奇怪的错误

时间:2016-08-19 15:54:02

标签: ruby-on-rails-5 capistrano3

我在rails 5应用程序上运行了$ cap production deploy。它一直工作到最后一步:

对我来说似乎是一个许可问题,但它早先正常工作。

unicorn:restart
      01 service unicorn_myApp_production restart
      01 Failed to restart unicorn_myApp_production.service: The name org.freedesktop.PolicyKit1 was not provided by any .serv…
      01 See system logs and 'systemctl status unicorn_myApp_production.service' for details.
(Backtrace restricted to imported tasks)
cap aborted!
SSHKit::Runner::ExecuteError: Exception while executing as marvin@bubbl.in: service exit status: 1
service stdout: Failed to restart unicorn_myApp_production.service: The name org.freedesktop.PolicyKit1 was not provided by any .service files
See system logs and 'systemctl status unicorn_myApp_production.service' for details.
service stderr: Nothing written

SSHKit::Command::Failed: service exit status: 1
service stdout: Failed to restart unicorn_myApp_production.service: The name org.freedesktop.PolicyKit1 was not provided by any .service files
See system logs and 'systemctl status unicorn_myApp_production.service' for details.
service stderr: Nothing written

Tasks: TOP => unicorn:restart
(See full trace by running task with --trace)
The deploy has failed with an error: Exception while executing as marvin@bubbl.in: service exit status: 1
service stdout: Failed to restart unicorn_myApp_production.service: The name org.freedesktop.PolicyKit1 was not provided by any .service files
See system logs and 'systemctl status unicorn_myApp_production.service' for details.
service stderr: Nothing written

** DEPLOY FAILED
** Refer to log/capistrano.log for details. Here are the last 20 lines:

 DEBUG [b9413f29] Command: ( export RBENV_ROOT="$HOME/.rbenv" RBENV_VERSION="2.3.1" ; /usr/bin/env mv /var/www/myApp/releases/…
  INFO [b9413f29] Finished in 0.111 seconds with exit status 0 (successful).
  INFO [cef268ae] Running /usr/bin/env sudo service delayed_job_myApp_production restart as marvin@bubbl.in
 DEBUG [cef268ae] Command: ( export RBENV_ROOT="$HOME/.rbenv" RBENV_VERSION="2.3.1" ; /usr/bin/env sudo service delayed_job_bubb…
  INFO [cef268ae] Finished in 21.242 seconds with exit status 0 (successful).
  INFO [41580c64] Running /usr/bin/env sudo /etc/init.d/nginx reload as marvin@bubbl.in
 DEBUG [41580c64] Command: ( export RBENV_ROOT="$HOME/.rbenv" RBENV_VERSION="2.3.1" ; /usr/bin/env sudo /etc/init.d/nginx reload…
 DEBUG [41580c64]   [....] Reloading nginx configuration (via systemctl): nginx.service
 DEBUG [41580c64]   
 DEBUG [41580c64]   
 DEBUG [41580c64]   
 DEBUG [41580c64]   [ ok 
 DEBUG [41580c64]   
 DEBUG [41580c64]   
 DEBUG [41580c64]   .
  INFO [41580c64] Finished in 0.268 seconds with exit status 0 (successful).
  INFO [84d3bdae] Running /usr/bin/env service unicorn_myApp_production restart as marvin@bubbl.in
 DEBUG [84d3bdae] Command: ( export RBENV_ROOT="$HOME/.rbenv" RBENV_VERSION="2.3.1" ; /usr/bin/env service unicorn_myApp_produ…
 DEBUG [84d3bdae]   Failed to restart unicorn_myApp_production.service: The name org.freedesktop.PolicyKit1 was not provided by…
See system logs and 'systemctl status unicorn_myApp_production.service' for details.

还有其他人遇到过这种情况吗?我做错了什么。

1 个答案:

答案 0 :(得分:1)

这是权限错误。在最后一行:

/usr/bin/env service myApp start

尝试:

/usr/bin/env sudo service myApp start
相关问题