Skip to content
This repository

NameError while doing cap deploy #45

Closed
mdemare opened this Issue May 24, 2012 · 16 comments

7 participants

Michiel de Mare Delano Mandelbaum Arkadiy Zabazhanov magic0fei Sun Zheng Marco Sandrini Simon Courtois
Michiel de Mare
mdemare commented May 24, 2012

This is on 2.5.1

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

Arkadiy Zabazhanov

Yep, got it too.

Delano Mandelbaum
Collaborator
delano commented May 24, 2012

What OS/Ruby version? Can you paste a full stack trace?

magic0fei

Same here. I'm running Mac OX Lion 10.7.4, ruby version is 1.9.3-p194.

Sun Zheng

Got same error on Gentoo Linux, with ruby 1.9.3-p0.

Delano Mandelbaum
Collaborator
delano commented May 24, 2012

Interesting. I don't see this on either test machine (OS X 10.6.8, CentOS 6) without Capistrano.

What is cap deploy doing to cause it? Any help/guidance appreciated.

Michiel de Mare
mdemare commented May 24, 2012

$ irb

require 'net/ssh'
Net::SSH::KnownHosts::SUPPORTED_TYPE

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

You've defined the constant in a class <<self block.

Delano Mandelbaum
Collaborator
delano commented May 24, 2012

Again, I don't see get that error on either test machine. Happy to merge in a pull request.

Marco Sandrini
nessche commented May 24, 2012

@delano Check my pull request #46

Marco Sandrini
nessche commented May 24, 2012

I ran simplecov on the test_all.rb script, and it appears that the line whre originally SUPPORTED_TYPE was referred to is not covered by the tests.

http://i46.tinypic.com/34pl7df.png

I ran the test on my branch so the culprit line reads now "next unless KnownHosts.supported_types.include? .....", but it still shows the reason why the gem tests did not discover the problem.

Michiel de Mare
mdemare commented May 24, 2012

Here's an explanation for why it's broken: http://stackoverflow.com/q/5250323/136

Delano Mandelbaum
Collaborator
delano commented May 24, 2012

Marco, thanks for the follow up. I believe the right solution is to move the SUPPORTED_TYPE constant from the metaclass to the class itself.

Btw for everyone reading, I'm a maintainer for this lib and not a developer which is why I put an emphasis on pull requests (see: http://solutious.com/blog/2009/06/19/net-ssh-repository/ ).

If someone can submit a patch with a test, I'll pull it into the repo and make a new release.

Marco Sandrini
nessche commented May 24, 2012

@delano : Agreed, I will move the whole if/else branch to the class, test it (just wrote the tests for it) and push it...

Simon Courtois

Any news on that subject ?

Marco Sandrini

Fixed in 2.5.2 to the best of my knowledge

Simon Courtois

Ok that's a good news, Il try to remove the gem 'net-ssh', '2.4.0' from my Gemfile and see if it's working :)

Simon Courtois

Yup it's working !
I guess the issue could be closed :)

Delano Mandelbaum delano closed this August 15, 2012
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Something went wrong with that request. Please try again.