我正在使用Capistrano v2.13.4进行部署。
未执行deploy:special_treats
之前的Capistrano任务(deploy:finalize_update
)。
任务deploy:special_treats
为bundle:install
做了一些准备工作(设置互联网访问权限),否则bundle:install
将无法访问互联网([out :: servername] Could not reach https://rubygems.org/
在config/deploy.rb
before 'deploy:finalize_update', 'deploy:special_treats'
和
namespace :deploy do
task :special_treats do
run "echo 'something special treats: setup the Internet access'"
end
end
cap deploy:update
$ cap deploy:update
* executing `deploy:update'
** transaction: start
* executing `deploy:update_code'
executing locally: "svn info https://svnlinks --username username --password password --no-auth-cache -rHEAD"
command finished in 10336ms
* getting (via export) revision 33268 to /tmp/20120927171608
executing locally: svn export -q --username username --password password --no-auth-cache -r33268 https://svnlinks /tmp/20120927171608
command finished in 79314ms
* processing exclusions...
* Compressing /tmp/20120927171608 to /tmp/20120927171608.tar.gz
executing locally: tar czf 20120927171608.tar.gz 20120927171608
command finished in 1401ms
servers: ["servername"]
** sftp upload /tmp/20120927171608.tar.gz -> /tmp/20120927171608.tar.gz
[servername] /tmp/20120927171608.tar.gz
[servername] done
* sftp upload complete
* executing "cd /usr/website/rr/releases && tar xzf /tmp/20120927171608.tar.gz && rm /tmp/20120927171608.tar.gz"
servers: ["servername"]
[servername] executing command
command finished in 774ms
* executing `deploy:finalize_update'
triggering before callbacks for `deploy:finalize_update'
* executing `bundle:install'
* executing "cd /usr/website/rr/releases/20120927171608 && bundle install --gemfile /usr/website/rr/releases/20120927171608/Gemfile --path /usr/website/rr/shared/bundle --deployment --quiet --without development
test"
servers: ["servername"]
[servername] executing command
** [out :: servername] Could not reach https://rubygems.org/
command finished in 1403ms
*** [deploy:update_code] rolling back
* executing "rm -rf /usr/website/rr/releases/20120927171608; true"
servers: ["servername"]
[servername] executing command
command finished in 344ms
failed: "rvm_path=$HOME/.rvm/ $HOME/.rvm/bin/rvm-shell '1.9.3-p194' -c 'cd /usr/website/rr/releases/20120927171608 && bundle install --gemfile /usr/website/rr/releases/20120927171608/Gemfile --path
/usr/website/rr/shared/bundle --deployment --quiet --without development test'" on servername
答案 0 :(得分:0)
我在after deploy:finalize_update
触发器中遇到了同样的问题。不同之处在于我的脚本在另一台机器上工作了很长时间。
我没有将capistrano锁定为Gemfile
中的宝石,所以我尝试恢复到2.6.0
的同一版本的工作机器但是没有修复它。
经过一些研究和几次试验后,我在github项目中发现了一些问题,如this导致that,但看起来人们无法完全重现它。
然后我转向文档并进行浏览我发现Capistrano行为受到0.9.x
版本rake的最新更改的影响,这些更改与命名空间冲突有关,正如您在这个简短的笔记中看到的那样可以在Capistrano Tasks wiki page
我没有时间修复脚本以使用rake和capistrano的最新版本,但是我可以通过将rake恢复为版本0.8.7
来让它在另一台机器上工作。
我希望这可以帮助您解决问题并提供一些线索。