VKGS VKGS - 1 month ago 11
Ruby Question

Using ruby whois

I need to retrieve whois informations for a given site. because the whois content varies with each whois server, i need to parse the whois content what i'm getting.

I'm using php to show the content from db and initially tried in php to parse it. now i came to know there is ruby whois package which parses whois content.

so the idea is running ruby program in the background to put whois content in db then show using php if requests made.

I've installed ruby 1.8.7 and whois and tried examples given in ruby document. But its giving

/opt/lampp/htdocs/labs/ruby/ruby-whois.rb:1: uninitialized constant Whois (NameError)

is rubywhois different from ruby? can anyone help me in this regard.


Have you installed the library with gem install whois? After that you have to require it in your code (require 'whois') in order to be able to use it.