23

I'm using Ruby 1.9.3, and when I execute Date.today, I get NoMethodError: undefined methodtoday' 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?

joslinm
  • 7,845
  • 6
  • 49
  • 72

1 Answers1

49

Did you require 'date' ?

> require 'date'
 => true
> Date.today
 => #<Date: 2013-03-12 ((2456364j,0s,0n),+0s,2299161j)>
Intrepidd
  • 19,772
  • 6
  • 55
  • 63