How to get today's date in Ruby 1.9.3?

date, ruby

Solution

Did you `require 'date'` ?

> require 'date'
 => true
> Date.today
 => #<Date: 2013-03-12 ((2456364j,0s,0n),+0s,2299161j)>

Problem

I'm using Ruby 1.9.3, and when I execute `Date.today`, I get `NoMethodError: undefined method`today' for Date:Class` I'm pretty confused about this since it does appear to be in the documentation. Though I know this is the documentation for 2.0, but I see answers ranging back to when it was implemented in 1.8.7. Was this removed in 1.9?

Original source