我正在通過cap staging deploy
首次部署到計算機。截至Cap3,deploy:setup
不再需要。然而,奇怪的是,我得到的mkdir權限錯誤:Capistrano 3首次部署失敗,出現/ var/www/XXX權限錯誤
INFO[cb348f12] Running /usr/bin/env mkdir -pv /var/www/myapp/shared /var/www/myapp/releases on ec2-xx-xx-xx-xx.us-west-2.compute.amazonaws.com
DEBUG[cb348f12] Command: /usr/bin/env mkdir -pv /var/www/myapp/shared /var/www/myapp/releases
DEBUG[cb348f12] mkdir:
DEBUG[cb348f12] cannot create directory ‘/var/www’
DEBUG[cb348f12] : Permission denied
DEBUG[cb348f12]
DEBUG[cb348f12] mkdir:
DEBUG[cb348f12] cannot create directory ‘/var/www’
DEBUG[cb348f12] : Permission denied
DEBUG[cb348f12]
cap aborted!
SSHKit::Runner::ExecuteError: Exception while executing on host ec2-xx-xx-xx-xx.us-west-2.compute.amazonaws.com: mkdir exit status: 1
當然,我能去的創建和chmod該目錄自己,但是這不是問題的關鍵。第3章本應該照顧自己。我很困惑,爲什麼它不這樣做。我還應該注意到,我之前用另一臺機器成功完成了同樣的設置(儘管這是「生產」環境)。
下面是我的一些deploy.rb基本設置:
set :application, "myapp"
set :user, 'ec2-user'
這只是我手動編輯日誌的工件 – Yevgeniy