sonatype / nexus-ruby-support

26 stars 7 forks source link

undefined method `strip' for nil:NilClass #45

Closed dpetzel closed 10 years ago

dpetzel commented 10 years ago

I have this issue on 0.2.5 as well as 1.0.0

$ gem nexus pkg\my.gem -c
Enter the URL of the rubygems repository on a Nexus server
URL:   http://my_url/
The Nexus URL has been stored in ~/.gem/nexus
Enter your Nexus credentials
Username:   me
Password: mine
Your Nexus credentials has been stored in ~/.gem/nexus
Uploading gem to Nexus...
ERROR:  While executing gem ... (NoMethodError)
    undefined method `strip' for nil:NilClass

It appears that the authorization is nil intentionally when the clear option is set as seen in https://github.com/sonatype/nexus-ruby-support/blob/master/nexus-gem/lib/commands/abstract_command.rb#L67.

Running with -c alone will throw an Please specify a gem name on the command line so it seems its impossible to cleanly clear the configuration.

I'm not sure if it makes more sense to have the authorization method always return even on a clear, or if send_gem should only add the authorization header if its not nil

mkristian commented 10 years ago

just pushed a gem (nexus-1.0.1) with some (or all) fixes you mentioned.

mkristian commented 10 years ago

so that should be fixed - please let me know if that still gives you troubles.

dpetzel commented 10 years ago

I'll should be able to test this in the next couple of days.

dpetzel commented 10 years ago

Looks good, thanks