2017-05-10 41 views
1

葛亭錯誤,同時部署,Capistrano的獨角獸重新啓動 - 高手未能啓動,檢查標準錯誤日誌的詳細信息

DEBUG [aaaad896] Command: cd /home/dev/PROJECT-NAME/current && (export RAILS_ENV="production" ; ~/.rvm/bin/rvm default do bundle exec unicorn -c /home/dev/PROJECT-NAME/current/config/unicorn.rb -E deployment -D ) 
DEBUG [aaaad896] master failed to start, check stderr log for details 
(Backtrace restricted to imported tasks) 
cap aborted! 
SSHKit::Runner::ExecuteError: Exception while executing as [email protected]: bundle exit status: 1 
bundle stdout: Nothing written 
bundle stderr: master failed to start, check stderr log for details 

其他日誌。

Errno::EADDRINUSE: Address already in use - bind(2) for 0.0.0.0:8080 
    /home/dev/PROEJCT-NAME/shared/bundle/ruby/2.3.0/gems/unicorn-5.1.0/lib/unicorn/socket_helper.rb:149:in `bind' 

unicorn.rb文件unicorn.rb

deploy.rb文件deploy.rb

默認(nginx的/站點啓用/默認)文件default

每當我重新啓動獨角獸時在capistrano出現這個錯誤。那我該如何解決這個問題?

回答

2

問題是你有另一個監聽端口8080的服務,這就是你的日誌所說的。如果您使用的是Linux,您可以檢查它正在使用的服務lsof -i:8080。這將告訴你誰在使用該端口。如果你可以殺死這個服務,只要做到這一點,如果你不能,只需要改變你的配置文件中的端口。

+0

部署後,我在代碼中做了一些更改,並再次使用「cap production deploy」命令進行部署。 (服務器已經運行),但那次我得到錯誤,因爲端口已經用於獨角獸。我想在運行瓶蓋生產部署時重新啓動我的獨角獸。 –

+0

有幾個選項可用於在部署帽後重新啓動獨角獸。你可以搜索谷歌看到,但這些[答案](http://stackoverflow.com/questions/19896800/starting-or-restarting-unicorn-with-capistrano-3-x)幫助你嗎? –

相關問題