title: Uninitialized constant ActiveSupport::TimeZone (NameError)
body: <p>I have some lines of code in my Ruby script that gets the current date (mine is in GMT) and converts it to ET (Eastern Time).</p>
  
  <p>I have this code in my Ruby script for that:</p>
  
  <pre><code># get current time and date in ET
  my_offset = 3600 * -5  # US Eastern
  
  # find the zone with that offset
  zone_name = ActiveSupport::TimeZone::MAPPING.keys.find do |name|
    ActiveSupport::TimeZone[name].utc_offset == my_offset
  end
  zone = ActiveSupport::TimeZone[zone_name]
  
  time_locally = Time.now
  time_in_zone = zone.at(time_locally)
  </code></pre>
  
  <p>The problem is it gives an error here (well, on this line): <code>zone_name = ActiveSupport::TimeZone::MAPPING.keys.find do |name|</code>: <code>uninitialized constant ActiveSupport::TimeZone (NameError)</code></p>
  
  <p>Anyone know what's wrong? I obtained this code segment from Stack Overflow, <a href="https://stackoverflow.com/questions/2927111/ruby-get-time-in-given-timezone">here</a>.</p>