If you do “gem install capistrano”, the gem package manager will go fetch the latest gem version of capistrano, currently 2.3.0 and installed in the gem repository. In case you want to have multiple version s of capistrano running, here’s how to do it.
To install older gem version of Capistrano
gem install –version 1.4.2 capistrano
(1.4.2 is the latest one in the 1.x branch before the release of 2.0)
To run specifically the 1.4.2 version, use
cap _1.4.2_ *your_tasks_here*
Shortcut
To reduce the typing, you can make an alias in your .bash_profile on Linux to run the 1.4.2 version as cap1 (cap 2.x.x is still running as cap) using
# add this line to .bash_profile
alias cap1=”cap _1.4.2_”
Afterwards, reload the profile with
$ source .bash_profile
Since I am on Windows, what I did was creating a batch file called “cap1.bat” and saved it within my system’s PATH environment. For simplicity’s sake, I save the cap1.bat file inside my C:\Windows\System32 folder
@echo off
cap _1.4.2_ %*
The special wildcard %* will be replaced with your command-line arguments, saving you the typing.
To read more about the Capistrano 1.4.2 version, check out Jamis’s post here.
Tags: capistrano, gem, rails, Ruby on Rails