Skip to content

NameError while doing cap deploy #45

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

7 participants

@mdemare
mdemare commented May 24, 2012

This is on 2.5.1

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

@pyromaniac

Yep, got it too.

@delano
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.

@davidsun

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

@delano
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.

@mdemare
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
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.

@nessche
nessche commented May 24, 2012

@delano Check my pull request #46

@nessche
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.

@mdemare
mdemare commented May 24, 2012

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

@delano
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.

@nessche
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...

@simonc
simonc commented Aug 13, 2012

Any news on that subject ?

@nessche
nessche commented Aug 13, 2012

Fixed in 2.5.2 to the best of my knowledge

@simonc
simonc commented Aug 13, 2012

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 :)

@simonc
simonc commented Aug 13, 2012

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

@delano delano closed this Aug 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.