Skip to content


Subversion checkout URL

You can clone with
Download ZIP


fixes #246. Silence the warning about redefining this constant from the s #247

merged 1 commit into from

fixes #246. Silence the warning about redefining this constant from the standard library.

I'm not CERTAIN this is the best solution, but it seems like if this constant was redefined on purpose (likely?), then it shouldn't be noisy.


I just saw this warning about 5m ago. :+1:

/cc @rkh

rkh commented

@raggi, could you double check?

@tenderlove tenderlove merged commit 8c638c2 into rack:master

Thanks Aaron. :)


I'm actually getting the reverse of this. I'm using rack 1.3.5 which includes this fix, and the error I get is:

C:/Ruby191/lib/ruby/gems/1.9.1/gems/rack-1.3.5/lib/rack/backports/uri/common_192.rb:53:in `remove_const': constant URI::WFKV_ not defined (NameError)

(line 53 is the fix: remove_const :WFKV_)

I'm not an expert, but I'm guessing this is something particular to my setup. I'm running Ruby 1.9.1 on Win7. gem list --local produces:

addressable (2.2.6)
albacore (0.2.5)
bundler (1.0.21)
deprecated (2.0.1)
haml (3.1.3)
heroku (2.9.0)
launchy (2.0.5)
mime-types (1.16)
pik (0.2.8)
rack (1.3.5)
rack-protection (1.1.4)
rest-client (1.6.7)
rubyzip (0.9.4)
sinatra (1.3.1)
term-ansicolor (1.0.7)
tilt (1.3.3)

@ternderlove - your backport, your duty :-P <3


I'm getting the same error as belfryimages. Also on Ruby 1.9.1 with Rack 1.3.5. Removing this fix worked.


Looks like this is a problem unique to Ruby 1.9.1. Do we support 1.9.1?


I don't really see the problem of adding remove_const :WFKV_ if defined?(WFKV_). It's also more future proof.


#173 explicitly restored 1.9.1 compatibility (also related to URI backport).


Trading a warning for a fatal error seems like a bad idea. @judofyr 's suggestion is a good one:

remove_const :WFKV_ if defined?(WFKV_)

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Commits on Oct 4, 2011
  1. @benhamill
This page is out of date. Refresh to see the latest.
Showing with 1 addition and 0 deletions.
  1. +1 −0  lib/rack/backports/uri/common_192.rb
1  lib/rack/backports/uri/common_192.rb
@@ -50,5 +50,6 @@ def self.decode_www_form_component(str, enc=Encoding::UTF_8)
str.gsub(/\+|%\h\h/, TBLDECWWWCOMP_).force_encoding(enc)
+ remove_const :WFKV_
WFKV_ = '(?:[^%#=;&]*(?:%\h\h[^%#=;&]*)*)' # :nodoc:
Something went wrong with that request. Please try again.