Install Capistrano 3 on Debian

This entry shows which steps to follow when installing Capistrano 3 on Debian. Root level access is required, on the same Jenkins machine used here.

NOTE: Capistrano 3 requires Ruby >= 1.9.

If Ruby 1.8 is installed, follow these steps to remove it, and install Ruby 1.9:

Based on http://makandracards.com/makandra/1104-upgrade-from-ruby-1-8-7-to-ruby-1-9-2-on-ubuntu

1. Remove ruby1.8:

apt-get remove ruby1.8 ruby

2. Install Ruby 1.9.2:

apt-get install ruby1.9.1 ruby1.9.1-dev

3. Link the ruby binary to /usr/bin/ruby:

ln -s /usr/bin/ruby1.9.1 /usr/bin/ruby

4. Download the latest rubygems to /tmp/, i.e. version 2.2.2:

cd /tmp/ && wget http://production.cf.rubygems.org/rubygems/rubygems-2.2.2.tgz

5. Extract the archive:

tar -zxvf rubygems-2.2.2.tgz

6. Install:

cd rubygems-2.2.2/ && ruby setup.rb

7. Link the gem binary, to /usr/bin/gem:

ln -s /usr/bin/gem1.9.1 /usr/bin/gem

8. Test version, using:

gem -v

2.2.2

9. Remove temporary install directory and arhive:

rm -rf /tmp/rubygems-2.2.2 && rm /tmp/rubygems-2.2.2.tgz 

Last step, is to actually install Capistrano:

gem install capistrano

Test installed version:

cap --version

Capistrano Version: 3.2.1 (Rake Version: 10.3.2)