alexdalitz / dnsruby

Dnsruby is a feature-complete DNS(SEC) client for Ruby, as used by many of the world's largest DNS registries and the OpenDNSSEC project
Other
194 stars 77 forks source link

`unknown_string': String IN not a member of Dnsruby::Classes #169

Closed Ressy66 closed 3 years ago

Ressy66 commented 3 years ago

disclaimer: I no nothing, actually, less than nothing about ruby. But I do know on the machine about to be decommisioned due to hardware adn OS age the ruby program we use has worked for many many years, but was ruby 1.8, currently new OS installs ruby 2.7.2, gems is 2.70 , installed dnsruby 1.61.5 from "gem install rubydns"

it said it installed successfully but program fails...

Traceback (most recent call last): 2: from ./zc.rb:213:in <main>' 1: from /usr/lib64/ruby/2.7.0/rubygems/core_ext/kernel_require.rb:92:inrequire' /usr/lib64/ruby/2.7.0/rubygems/core_ext/kernel_require.rb:92:in require': cannot load such file -- dnsruby (LoadError) 26: from ./zc.rb:213:in

' 25: from /usr/lib64/ruby/2.7.0/rubygems/core_ext/kernel_require.rb:156:in require' 24: from /usr/lib64/ruby/2.7.0/rubygems/core_ext/kernel_require.rb:168:inrescue in require' 23: from /usr/lib64/ruby/2.7.0/rubygems/core_ext/kernel_require.rb:168:in require' 22: from /usr/lib64/ruby/gems/2.7.0/gems/Dnsruby-1.0/lib/dnsruby.rb:87:in<top (required)>' 21: from /usr/lib64/ruby/gems/2.7.0/gems/Dnsruby-1.0/lib/dnsruby.rb:383:in <module:Dnsruby>' 20: from /usr/lib64/ruby/gems/2.7.0/gems/Dnsruby-1.0/lib/dnsruby.rb:477:in' 19: from /usr/lib64/ruby/2.7.0/rubygems/core_ext/kernel_require.rb:72:in require' 18: from /usr/lib64/ruby/2.7.0/rubygems/core_ext/kernel_require.rb:72:inrequire' 17: from /usr/lib64/ruby/gems/2.7.0/gems/Dnsruby-1.0/lib/Dnsruby/message.rb:17:in <top (required)>' 16: from /usr/lib64/ruby/2.7.0/rubygems/core_ext/kernel_require.rb:72:inrequire' 15: from /usr/lib64/ruby/2.7.0/rubygems/core_ext/kernel_require.rb:72:in require' 14: from /usr/lib64/ruby/gems/2.7.0/gems/Dnsruby-1.0/lib/Dnsruby/resource/resource.rb:461:in<top (required)>' 13: from /usr/lib64/ruby/2.7.0/rubygems/core_ext/kernel_require.rb:72:in require' 12: from /usr/lib64/ruby/2.7.0/rubygems/core_ext/kernel_require.rb:72:inrequire' 11: from /usr/lib64/ruby/gems/2.7.0/gems/Dnsruby-1.0/lib/Dnsruby/resource/generic.rb:134:in <top (required)>' 10: from /usr/lib64/ruby/2.7.0/rubygems/core_ext/kernel_require.rb:72:inrequire' 9: from /usr/lib64/ruby/2.7.0/rubygems/core_ext/kernel_require.rb:72:in require' 8: from /usr/lib64/ruby/gems/2.7.0/gems/Dnsruby-1.0/lib/Dnsruby/resource/PX.rb:16:in<top (required)>' 7: from /usr/lib64/ruby/gems/2.7.0/gems/Dnsruby-1.0/lib/Dnsruby/resource/PX.rb:17:in <module:Dnsruby>' 6: from /usr/lib64/ruby/gems/2.7.0/gems/Dnsruby-1.0/lib/Dnsruby/resource/PX.rb:18:in' 5: from /usr/lib64/ruby/gems/2.7.0/gems/Dnsruby-1.0/lib/Dnsruby/resource/PX.rb:19:in <module:IN>' 4: from /usr/lib64/ruby/gems/2.7.0/gems/Dnsruby-1.0/lib/Dnsruby/resource/PX.rb:20:in' 3: from /usr/lib64/ruby/gems/2.7.0/gems/Dnsruby-1.0/lib/Dnsruby/code_mapper.rb:81:in method_missing' 2: from /usr/lib64/ruby/gems/2.7.0/gems/Dnsruby-1.0/lib/Dnsruby/code_mapper.rb:81:innew' 1: from /usr/lib64/ruby/gems/2.7.0/gems/Dnsruby-1.0/lib/Dnsruby/code_mapper.rb:88:in initialize' /usr/lib64/ruby/gems/2.7.0/gems/Dnsruby-1.0/lib/dnsruby.rb:137:inunknown_string': String IN not a member of Dnsruby::Classes (ArgumentError)

keithrbennett commented 3 years ago

It looks like you are using an ancient version of dnsruby. The current version is 1.61.5. Can you use the newer version?

The capitalization of Dnsruby in the error messages is surprising, but maybe that's what it was back then.

You said you installed rubydns but you meant dnsruby, right?

Ressy66 commented 3 years ago

Hi, Yes I checked scrollback, it was definitely dnsruby thats tjhe one gem just installed the Dnsruby was already there, do you think its safe for me to try gem uninstall Dnsruby or might it take out dnsruby as well?

gem outdated shows about 15 pkgs but none of them are dns related (hesitant becasue it lists the openssl 2.1.2 <2.2.0 and ive played dep-hell due to openssl1.1.1.h being on here with so much wanting 1.0.2 and trying not to break anything else openssl related :)

keithrbennett commented 3 years ago

I don't think having both dnsruby and Dnsruby would be a problem, since your OS (Unix) is almost certainly using a case sensitive filesystem, but if you want to be super careful you could uninstall Dnsruby first. Your local gem repository has a cache directory which stores the original .gem files, so you could cd $GEM_HOME/cache, find the Dnsruby gem, and copy it somewhere to save a copy of it before uninstalling.

keithrbennett commented 3 years ago

I suggested saving a copy because you could then reinstall the gem from that file (gem install Dnsruby*.gem instead of the usual form gem install Dnsruby. However, I checked, and Dnsruby is still available online, so you probably don't need to save a copy of it:

% gem list --remote Dnsruby

*** REMOTE GEMS ***

Dnsruby (1.0)
dnsruby (1.61.5)
rspec-dnsruby (0.1.1)
keithrbennett commented 3 years ago

I just researched this further. Dnsruby is the earlier version of this gem, up to version 1.0, in the year 2009. dnsruby carries it on to versions 1.1 and later. See:

https://rubygems.org/gems/Dnsruby https://rubygems.org/gems/dnsruby

Ressy66 commented 3 years ago

Hi Keith, thanks, I un-installed Dnsruby, reinstalled dnsruby, and it was all good, no idea why gems 2.7 has such old version, is it in default base gems? or perhaps thats slackwares doing? It has ruby 2.7.2 which google tells me is only from Oct this year?

if I scan the package its docs are 2.7.2, the libruby.so is 2.7.2 , ruby -v says 2.7.2p137 but all other ruby files in the package are 2.7.0 is that normal?

keithrbennett commented 3 years ago

Where was the Dnsruby gem specified? If you asked for Dnsruby in the Gemfile, *.gemspec file, etc., that is the one you would get, not dnsruby.

Yes, the 2.7.2 / 2.7.0 thing is normal.

Personally, I use rvm for Ruby version and gem management. Other people like rbenv and asdf.

Ressy66 commented 3 years ago

Dnsruby was specified all throughout the code require 'dnsruby' then theres stuff that says old_dnsruby which looks like is where it goes to Dnbsruby and for some reason preferred old The code is a number of years old (obviously) but looks like its sorted.