2011-11-04 56 views
0

我有一個Rails 3.1.1應用程序,我試圖通過Capistrano進行部署。這是我的第一次嘗試,我通過做了大量的研究來解決了幾個問題,但是我碰到了一堵牆,我無法找到一種擴展方法。使用Rails 3.1.1和Site5的Cap Deploy問題

我可以運行cap deploy:setup和cap deploy:檢查沒有發生。當我嘗試和運行帽部署,這是我所得到的看到(有關耙0.9.2.2和底部的失敗行分隔文本)

亞倫 - 約翰遜 - 的Macbook-PRO底:webd2 aaronjohnsonis $帽部署* 正在執行deploy' * executing部署:更新'**事務: 開始*執行deploy:update_code' updating the cached checkout on all servers executing locally: "git ls-remote [email protected]:webdsquared/webd2.git master" command finished in 2351ms * executing "if [ -d /home/webdsqua/apps/webd2/shared/cached-copy ]; then cd /home/webdsqua/apps/webd2/shared/cached-copy && git fetch origin && git fetch --tags origin && git reset --hard 28e67c5f7e1ed4612dffd2ac4fb287356f51ce3b && git submodule init && for mod in git子模塊狀態| AWK '{打印$ 2}' ; do git config -f .git/config submodule.${mod}.url混帳配置-f .gitmodules --get 子模塊$ {MOD}的.url && echo Synced $mod; done && git submodule sync && export GIT_RECURSIVE=$([ ! \"的git --version \" \\< \"git version 1.6.5\" ] && echo --recursive) && git submodule update --init $GIT_RECURSIVE && git clean -d -x -f; else git clone --depth 1 [email protected]:webdsquared/webd2.git /home/webdsqua/apps/webd2/shared/cached-copy && cd /home/webdsqua/apps/webd2/shared/cached-copy && git checkout -b deploy 28e67c5f7e1ed4612dffd2ac4fb287356f51ce3b && git submodule init && git submodule sync && export GIT_RECURSIVE=$([ ! \"的git --version \" \\< \"git version 1.6.5\" ] && echo --recursive) && git submodule update --init $GIT_RECURSIVE; fi" servers: ["webdsquared.com"] Password: [webdsquared.com] executing command ** [webdsquared.com :: out] HEAD is now at 28e67c5 initial commit command finished in 2428ms copying the cached version to /home/webdsqua/apps/webd2/releases/20111104183017 * executing "cp -RPp /home/webdsqua/apps/webd2/shared/cached-copy /home/webdsqua/apps/webd2/releases/20111104183017 && (echo 28e67c5f7e1ed4612dffd2ac4fb287356f51ce3b > /home/webdsqua/apps/webd2/releases/20111104183017/REVISION)" servers: ["webdsquared.com"] [webdsquared.com] executing command command finished in 2997ms * executing部署:finalize_update」 回調deploy:finalize_update' * executing部署之前觸發:資產:符號鏈接」 *執行「室射頻 /家庭/ webdsqua /應用/ webd2 /發行/ 20111104183017 /公/資產& & \\ñ 的mkdir -p /家庭/ webdsqua /應用/ webd2 /發行/ 20111104183017 /公共 & & \\ñ的mkdir -p /家庭/ webdsqua /應用/ webd2 /共享/資產& & \\ñ LN -s /家庭/ webdsqua /應用/ webd2 /共享/資產 /home/webdsqua/apps/webd2/releases/20111104183017/public/assets「 servers:[」webdsquared.com「] [webdsquared.com]執行命令 命令在1104ms結束*執行」chmod -R g + w /主頁/ webdsqua/apps/webd2/releases/20111104183017「 服務器:[」webdsquared.com「] [webdsquared.com]執行命令 命令在119ms內完成*執行」rm -rf/home/webdsqua/apps/webd2 /發佈/ 20111104183017 /日誌 /家庭/ webdsqua /應用/ webd2 /發行/ 20111104183017 /公/系統 /家庭/ webdsqua /應用/ webd2 /發行/ 20111104183017的/ tmp/PID的& & \\ñ
的mkdir -p/home/webdsqua/apps/webd2/releases/20111104183017/public & & \\ñ的mkdir -p /家庭/ webdsqua /應用/ webd2 /發行/ 20111104183017/tmp目錄& & \\ñLN -s /家庭/ webdsqua /應用/ webd2 /共享/日誌/家庭/ webdsqua /應用程序/ webd2 /發行/ 20111104183017 /日誌& & \\ñLN -s /家庭/ webdsqua /應用/ webd2 /共享/系統的/ home/webdsqua /應用/ webd2 /發行/ 20111104183017 /公/系統& & \\ n ln -s/home/webdsqua/apps/webd2/shared/pids /home/webdsqua/apps/webd2/releases/20111104183017/tmp/pids「 servers:[」webdsquared.com「] [webdsquared.com ]執行命令 逗號資產:預編譯」 *執行 「CD /家庭/ webdsqua /應用/ webd2 /發行/ 20111104183017 & &耙 RAILS_ENV =生產RAILS_GROUPS =資產資產:預編譯」 次在3136ms 爲deploy:update_code' * executing部署回調後觸發完成服務器:[「webdsquared.com」] [webdsquared.com]執行命令

** [out :: webdsquared.com](in/home/webdsqua/apps/webd2/releases/20111104183017)** [out > :: webdsquared。com]在任何源中找不到rake-0.9.2.2 命令在1108ms完成 * [deploy:update_code]回滾*執行「rm -rf/home/webdsqua/apps/webd2/releases/20111104183017; true 「 服務器:」 webdsquared.com 「] [webdsquared.com]執行命令 **命令在113ms完成了失敗:」 SH -c「坎德拉/家/ webdsqua /應用/ webd2 /發行/ 20111104183017 & &耙 RAILS_ENV =生產RAILS_GROUPS =資產資產:預編譯'」上 webdsquared.com **

我deploy.rb文件LO OKS像這樣...

set :application, "app" 
set :repository, "[email protected]:webdsquared/app.git" 

set :scm, "git" 
set :deploy_to, "/home/username/apps/#{application}" 

set :user, "username" 
set :use_sudo, false 
set :deploy_via, :remote_cache 
set :keep_releases, 3 
set :normalize_asset_timestamps, false 
set :git_enable_submodules, 1 
set :branch, "master" 
set :git_shallow_clone, 1 
set :scm_verbose, true 

role :web, "webdsquared.com"       
role :app, "webdsquared.com"       
role :db, "webdsquared.com", :primary => true      

after "deploy", "deploy:restart" 

namespace :deploy do 
    task :start do ; end 
    task :stop do ; end 
    task :restart, :roles => :app, :except => { :no_release => true } do 
    run "touch #{File.join(current_path,'tmp','restart.txt')}" 
    end 
end 

的Capfile看起來像這樣...

load 'deploy' if respond_to?(:namespace) # cap2 differentiator 

Dir['vendor/gems/*/recipes/*.rb','vendor/plugins/*/recipes/*.rb'].each { |plugin| load(plugin) } 

load 'config/deploy' # remove this line to skip loading any of the default tasks 

任何意見將非常感激。有沒有人經歷過同樣的事情並找到解決方案?

在此先感謝。

回答

0

你正在運行什麼版本的capistrano?您是否在應用程序中使用了捆綁程序?問題是Capistrano在運行命令時沒有使用bundle exec ...它應該運行bundle exec rake...不只是rake...