From: Ron Fox Date: 2008-03-03T22:39:59+09:00 Subject: Re: How do I get the server name? How about require "socket" ... host_name = Socket::gethostname RF laredotornado wrote: > On Mar 2, 4:48 pm, Jano Svitok wrote: >> On Sun, Mar 2, 2008 at 11:42 PM, Andrei Maxim wrote: >>> I was actually surprised to see that ENV.class returns Object. It >>> certainly acts like a Hash so... >> http://ruby-doc.org/docs/ProgrammingRuby/html/rubyworld.html#S3 > > Thanks all for your replies but there's something odd. I guess I'm > still confused about how to access values from this thing that is not > quite a hash. In irb, I did as Andrei suggested and thought I saw a > HOSTNAME key, but when I try and print out the value ("puts > ENV['HOSTNAME']"), I get nil. Why does it appear when I print out the > hash but not when I try and access the value individually? >