Skip to content


Subversion checkout URL

You can clone with HTTPS or Subversion.

Download ZIP


fix excon adapter version #202

wants to merge 1 commit into from

3 participants

Roberto Miranda Bartosz Blimke Andreas Bauer
Roberto Miranda

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

Bartosz Blimke

What version of Excon do you use? I can see Excon::VERSION defined in current version 0.15.5.

Roberto Miranda

:O I'm using excon "0.14.3"

Roberto Miranda

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?

Bartosz Blimke

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

Roberto Miranda

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
Bartosz Blimke


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

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?

Bartosz Blimke bblimke closed this
Andreas Bauer

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 returns true and prevents Excon::VERSION to be defined correctly.

A workaround is to load excon as soon as possible.

Bartosz Blimke

@bauersman are you sure that's the case? Can you please show a code snippet to reproduce that? only checks if VERSION constant
is defined inside Excon module.

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

Andreas Bauer

Sure, minimal test case here:

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

Bartosz Blimke

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

Bartosz Blimke

I created an issue in Excon excon/excon#147

Murahashi Sanemat Kenichi sanemat referenced this pull request from a commit in sanemat/webmock
Murahashi Sanemat Kenichi sanemat Add license in .gemspec
Rubygems warns empty license
Warn is licenses is empty. Fixes #202 · ed1098d · rubygems/rubygems
Murahashi Sanemat Kenichi sanemat referenced this pull request

Add license in .gemspec #235

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Commits on Aug 13, 2012
  1. Roberto Miranda
This page is out of date. Refresh to see the latest.
Showing with 1 addition and 1 deletion.
  1. +1 −1  lib/webmock/http_lib_adapters/excon_adapter.rb
2  lib/webmock/http_lib_adapters/excon_adapter.rb
@@ -5,7 +5,7 @@
if defined?(Excon)
-'Excon', Excon::VERSION, '0.9.6').check_version!
+'Excon', Gem.loaded_specs["excon"].version.to_s, '0.9.6').check_version!
module WebMock
module HttpLibAdapters
Something went wrong with that request. Please try again.