我正在使用Ruby on Rails 3.0.9,並試圖設置Capistrano創業板(下面的敏捷Web開發與導軌書 - 第四版)。我在遠程機器上設置了git和所有相關目錄\文件(它工作)以及與Capistrano相關的所有「基本」事情。現在,如果我從我的本地機器上運行下面的命令,如預期的工作:在服務器上部署與Capistrano
cap deploy:setup
# ...
cap deploy:check
# ...
# You appear to have all necessary dependencies installed
這時我的項目目錄中,我有以下目錄(由Capistrano的創建):
<my_project_dir>/releases
<my_project_dir>/shared
沒有更多。
我現在應該做什麼?例如,我是否需要將所有應用程序文件從本地計算機上傳到遠程計算機?
P.S .:我也設置我的Apache2服務器指向<my_project_dir>/current/public
目錄,但Capistrano沒有創建該文件夾。
UPDATE爲@Alex
如果我運行cap deploy
命令我得到以下幾點:
* executing `deploy'
* executing `deploy:update'
** transaction: start
* executing `deploy:update_code'
updating the cached checkout on all servers
executing locally: "git ls-remote [email protected]<SERVER_IP_ADDRESS>:/git/<my_project_name>.com.git master"
command finished in 3086ms
* executing "if [ -d /srv/www/<my_project_name>.com/shared/cached-copy ]; then cd /srv/www/<my_project_name>.com/shared/cached-copy && git fetch -q origin && git fetch --tags -q origin && git reset -q --hard 36ccf7b6f63041ee8dcdf4ca0a7c0b10dbc8bad1 && git clean -q -d -x -f; else git clone -q [email protected]<SERVER_IP_ADDRESS>:/git/<my_project_name>.com.git /srv/www/<my_project_name>.com/shared/cached-copy && cd /srv/www/<my_project_name>.com/shared/cached-copy && git checkout -q -b deploy 36ccf7b6f63041ee8dcdf4ca0a7c0b10dbc8bad1; fi"
servers: ["<SERVER_IP_ADDRESS>"]
[<SERVER_IP_ADDRESS>] executing command
** [<SERVER_IP_ADDRESS> :: err] Host key verification failed.
** [<SERVER_IP_ADDRESS> :: err] fatal: The remote end hung up unexpectedly
command finished in 396ms
*** [deploy:update_code] rolling back
* executing "rm -rf /srv/www/<my_project_name>.com/releases/20110820175634; true"
servers: ["<SERVER_IP_ADDRESS>"]
[<SERVER_IP_ADDRESS>] executing command
command finished in 353ms
failed: "sh -c 'if [ -d /srv/www/<my_project_name>.com/shared/cached-copy ]; then cd /srv/www/<my_project_name>.com/shared/cached-copy && git fetch -q origin && git fetch --tags -q origin && git reset -q --hard 36ccf7b6f63041ee8dcdf4ca0a7c0b10dbc8bad1 && git clean -q -d -x -f; else git clone -q [email protected]<SERVER_IP_ADDRESS>:/git/<my_project_name>.com.git /srv/www/<my_project_name>.com/shared/cached-copy && cd /srv/www/<my_project_name>.com/shared/cached-copy && git checkout -q -b deploy 36ccf7b6f63041ee8dcdf4ca0a7c0b10dbc8bad1; fi'" on <SERVER_IP_ADDRESS>
注:failed: ...
在最後一行。問題是什麼?
你有沒有嘗試帽部署? – Alex
@Alex - 我更新了問題。 – Backo
您是否使用公鑰/私鑰對使用SSH訪問機器? – Alex