capistrano - NameError: uninitialized constant Net::SSH::KnownHosts::SUPPORTED_TYPE

5.6k views Asked by At

I'm trying to deploy my Rails (3.1.3) application to the preprod env. I use capistrano (2.12.0) and rvm-capistrano (1.2.2).

When I call bundle exec cap ssh it works fine. But when I call bundle exec cap deploy I get the following trace:

$ cap deploy
    triggering start callbacks for `deploy'
  * 18:42:19 == Currently executing `multistage:ensure'
*** Defaulting to `preprod'
  * 18:42:19 == Currently executing `preprod'
  * 18:42:19 == Currently executing `deploy'
  * 18:42:19 == Currently executing `deploy:update'
 ** transaction: start
  * 18:42:19 == Currently executing `deploy:update_code'
  * 18:42:19 == Currently executing `deploy:set_previous_revision'
  * executing "cd /rails_apps/com.example.preprod/current; git rev-parse --short HEAD"
    servers: ["preprod.example.com"]
connection failed for: preprod.example.com (NameError: uninitialized constant Net::SSH::KnownHosts::SUPPORTED_TYPE)

Of course example.com is a placeholder, it doesn't come from a mistake in the capistrano config.

Any idea of what could cause that ?

I'm using RVM with Ruby 1.9.3-p194.

Thanks !

2

There are 2 answers

3
Oliver On BEST ANSWER

Reverting back from net-ssh 2.5.1 to 2.4.0 seems to solve the problem for now.

0
ServerYang On

I installed rvm-capistrano gem to solved this problem:

gem install rvm-capistrano