[HOWTO] Transfer Capistrano 2 to Capistrano 3 Using Ruby on Rails
At First, Why I want to transfer from Capistrano2 to Capistrano3?
First, I often stuck at precompile…
and sometimes I get [deploy:update_code] exception while rolling back: Net::SSH::Disconnect, connection closed by remote host”
Third, every deployments take about 10~15 minuates.
So…. that’s why I want to change to capistrano 3.
this post is inspired by https://semaphoreapp.com/blog/2013/11/26/capistrano-3-upgrade-guide.html
But I still have some problems. Here I demo source code from my project and show how I fix these problems.
Just move your old “cap” files to a folder
cd YOUR_PROJECT mkdir old_cap mv Capfile old_cap mv config/deploy.rb old_cap mv config/deploy/mv old_cap
gem “capistrano-rails” = gem ‘capistrano’ + gem ‘capistrano-ext’ + gem ‘capistrano_colors’
If you want to know what is the deploy flow if you require these files
I use asset_sync to sync assets to S3.
Notice: within must inside roles or you will get no method problem.
more details https://github.com/capistrano/sshkit