fix excon adapter version #202

Closed
wants to merge 1 commit into
from

Conversation

Projects
None yet
3 participants

When tried to run the tests using excon adapter, I got this error

uninitialized constant Excon::VERSION

The issue was that excon doesn't define this varible Excon::VERSION

Owner

bblimke commented Aug 13, 2012

What version of Excon do you use? I can see Excon::VERSION defined in current version 0.15.5. https://github.com/geemus/excon/blob/master/lib/excon/constants.rb#L3

:O I'm using excon "0.14.3"

sure, but for some reason doesn't works and can't upgrade excon, because I'm using fog too that depends of excon ~> 0.14. any suggestions for this case?

Owner

bblimke commented Aug 14, 2012

can you try loading irb, require excon and see it Excon::VERSION is available?

no, looks like is not available

irb(main):001:0> Excon
=> Excon
irb(main):002:0> Excon::VERSION
NameError: uninitialized constant Excon::VERSION
    from (irb):2
Owner

bblimke commented Aug 14, 2012

Weird.

> require 'rubygems'
 => true 
> require 'excon'
 => true 
> Excon::VERSION
 => "0.14.3" 
Owner

bblimke commented Aug 15, 2012

Can you investigate this Excon class and ensure it's the one from Excon 0.14.3 gem? Maybe there is some other code defining it?

bblimke closed this Aug 26, 2012

I ran into the same problem and found out that some gems define a top-level VERSION constant. In my case it was 'its-it', by including their main module into the top-level object.

If excon is loaded after that, the check at https://github.com/geemus/excon/blob/v0.14.3/lib/excon/constants.rb#L2 returns true and prevents Excon::VERSION to be defined correctly.

A workaround is to load excon as soon as possible.

Owner

bblimke commented Sep 11, 2012

@bauersman are you sure that's the case? Can you please show a code snippet to reproduce that?

https://github.com/geemus/excon/blob/v0.14.3/lib/excon/constants.rb#L2 only checks if VERSION constant
is defined inside Excon module.

In Ruby you always have top level VERSION constant which represents Ruby version.

Sure, minimal test case here: https://github.com/bauersman/ruby-global-constant-inheritance

Edit: the global constant representing the ruby version is RUBY_VERSION, not VERSION

Owner

bblimke commented Sep 11, 2012

It's a change in behaviour between ruby 1.8 and ruby 1.9. looks like this behaviour only appears in 1.9

Owner

bblimke commented Sep 11, 2012

I created an issue in Excon geemus/excon#147

@sanemat sanemat added a commit to sanemat/webmock that referenced this pull request Dec 22, 2012

@sanemat sanemat Add license in .gemspec
Rubygems warns empty license
Warn is licenses is empty. Fixes #202 · ed1098d · rubygems/rubygems
rubygems/rubygems@ed1098d
4790789

sanemat referenced this pull request Dec 22, 2012

Closed

Add license in .gemspec #235

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment