Ruby Sinatra Hello World Error in `remove_const ': persistent URI :: WFKV_ not defined (NameError)

Just trying to run a simple HTTP server and not have a clue about ruby

/usr/local/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) from /usr/local/lib/ruby/gems/1.9.1/gems/rack-1.3.5/lib/rack/backports/uri/common_192.rb:53:in `<module:URI>' from /usr/local/lib/ruby/gems/1.9.1/gems/rack-1.3.5/lib/rack/backports/uri/common_192.rb:19:in `<top (required)>' from /usr/local/lib/ruby/gems/1.9.1/gems/rack-1.3.5/lib/rack/utils.rb:12:in `require' from /usr/local/lib/ruby/gems/1.9.1/gems/rack-1.3.5/lib/rack/utils.rb:12:in `<top (required)>' from /usr/local/lib/ruby/gems/1.9.1/gems/rack-1.3.5/lib/rack/request.rb:1:in `require' from /usr/local/lib/ruby/gems/1.9.1/gems/rack-1.3.5/lib/rack/request.rb:1:in `<top (required)>' from /usr/local/lib/ruby/gems/1.9.1/gems/rack-1.3.5/lib/rack/showexceptions.rb:3:in `require' from /usr/local/lib/ruby/gems/1.9.1/gems/rack-1.3.5/lib/rack/showexceptions.rb:3:in `<top (required)>' from /usr/local/lib/ruby/gems/1.9.1/gems/sinatra-1.3.1/lib/sinatra/showexceptions.rb:1:in `require' from /usr/local/lib/ruby/gems/1.9.1/gems/sinatra-1.3.1/lib/sinatra/showexceptions.rb:1:in `<top (required)>' from /usr/local/lib/ruby/gems/1.9.1/gems/sinatra-1.3.1/lib/sinatra/base.rb:12:in `require' from /usr/local/lib/ruby/gems/1.9.1/gems/sinatra-1.3.1/lib/sinatra/base.rb:12:in `<top (required)>' from /usr/local/lib/ruby/gems/1.9.1/gems/sinatra-1.3.1/lib/sinatra.rb:4:in `require' from /usr/local/lib/ruby/gems/1.9.1/gems/sinatra-1.3.1/lib/sinatra.rb:4:in `<top (required)>' from http.rb:1:in `require' from http.rb:1:in `<main>' 

and here is my version of ruby ​​on centos ruby 1.9.1p376 (2009-12-07 revision 26041) [x86_64-linux]

any help would be much appreciated

+4
source share
1 answer

This known issue applies to ruby-1.9.1 and rake-1.3.5. Take a look. How about updating ruby ​​for version 1.9.2 or 1.9.3?

UPDATE

On the one hand, the constant WFKV_ was absent in version ruby ​​1.9.1 and appears in version 1.9.2. On the other hand, this constant is defined in the uri / common_192.rb file. 2011-10-03 Ben Hamill fixed issue # 246 "Silent warning about overriding this constant from the standard library" by adding the remove_const :WFKV_ , and this fix was included in rack-1.3.5. Therefore, if you are using version 1.9.1, you need to use rack-1.3.4.

+6
source

Source: https://habr.com/ru/post/1379418/


All Articles