weppos / whois-parser

An intelligent — pure Ruby — WHOIS parser.
https://whoisrb.org
MIT License
99 stars 102 forks source link

Broken with activesupport 7: uninitialized constant ActiveSupport::XmlMini::IsolatedExecutionState #141

Open DannyBen opened 2 years ago

DannyBen commented 2 years ago

When activesupport 7 is installed, the gem breaks with this error:

Error

/home/vagrant/.rbenv/versions/3.0.1/lib/ruby/gems/3.0.0/gems/activesupport-7.0.0
/lib/active_support/xml_mini.rb:184:in `current_thread_backend': uninitialized constant ActiveSupport::XmlMini::IsolatedExecutionState (NameError)
        from /home/vagrant/.rbenv/versions/3.0.1/lib/ruby/gems/3.0.0/gems/activesupport-7.0.0/lib/active_support/xml_mini.rb:103:in `backend='
        from /home/vagrant/.rbenv/versions/3.0.1/lib/ruby/gems/3.0.0/gems/activesupport-7.0.0/lib/active_support/xml_mini.rb:201:in `<module:ActiveSupport>'
        from /home/vagrant/.rbenv/versions/3.0.1/lib/ruby/gems/3.0.0/gems/activesupport-7.0.0/lib/active_support/xml_mini.rb:11:in `<top (required)>'
        # ...

Reproduction

require 'bundler/inline'

gemfile do
  source "https://rubygems.org"
  gem 'whois-parser'
  gem 'activesupport', '>= 7'   # FAIL
  # gem 'activesupport', '< 7'      # PASS
end

c = Whois::Client.new
p c.lookup("google.com")
jarthod commented 2 years ago

@DannyBen this gem is not maintained at the moment so after asking the maintainer I ended up starting my fork in which I merged some of the pending PRs and provided a lot more fixes. I fixed support for ActiveSupport 7 in 399fd2aebbf442682694c1f7ca66c8350c838967. So you can use my fork in the meantime and hopefully one day we'll be able to merge upstream:

gem 'whois-parser', github: 'jarthod/whois-parser' # Unofficial but more up-to-date fork, check status at https://github.com/jarthod/whois-parser
DannyBen commented 2 years ago

Thanks. Perhaps the maintainer can state this in the README.

jarthod commented 2 years ago

That would be nice yes, unfortunately we can't do it for him and he doesn't merge anything :confused: