4

I am using ruby 1.8.7 (2013-06-27 patchlevel 374) [i686-darwin14]. When I try to install the capistrano gem I get the following error:

sudo gem install capistrano -v2.13.5
ERROR:  Error installing capistrano:
    net-ssh requires Ruby version >= 2.0.

AFAIK capistrano 2.13.5 should be compatible with ruby 1.8.7

How can I install capistrano v2.13.5 with ruby 1.8.7 (<2.0) installed?

Radix
  • 2,527
  • 1
  • 19
  • 43
Fabrizio Fortino
  • 1,479
  • 1
  • 14
  • 22

4 Answers4

6

I have sorted this problem out manually installing the capistrano dependencies. Execute the following commands if you have the same problem:

sudo gem install net-sftp -v2.0.0
sudo gem install net-scp -v1.0.0
sudo gem install net-ssh-gateway -v1.1.0
sudo gem install capistrano -v2.13.5
Fabrizio Fortino
  • 1,479
  • 1
  • 14
  • 22
  • 1
    in my case installing net-sftp -v 2.0.0 has the same problem. Solution is to install net-ssh -v 2.6.5 before installing capistrano. – Dragan Nikolic Jan 26 '16 at 19:38
5

I had the same error message when installing Capifony in Ubuntu 14.04. I did this:

# gem install net-ssh -v 2.9.2

And then this:

# gem install capifony

It worked.

I found the solution described here.

Đuro Mandinić
  • 693
  • 1
  • 8
  • 26
1

Even after installing the dependancies the capistrano installation process was asking for net-ssh that required ruby >= 2.

I had to download the source that I wanted from https://github.com/capistrano/capistrano/releases. Unzip, cd into the directory, and run:

gem build capistrano.gemspec
gem install --local capistrano-2.15.5.gem
Tunaki
  • 132,869
  • 46
  • 340
  • 423
Travis
  • 3,156
  • 3
  • 21
  • 27
1

Capistrano is trying to install latest version of its dependency (net-ssh) which is not compatible with ruby versions prior v2.0. The solution is to install proper version of that dependency prior to installing capistrano. Proper version means the dependency is compatible with both Ruby and capistrano. In this case that is net-ssh v 2.6.5. So following sequence works:

gem install net-ssh -v 2.6.5
gem install capistrano -v 2.13.5
Dragan Nikolic
  • 1,536
  • 3
  • 17
  • 24