Search code examples
rubynitrousio

Trouble with calling Ruby Date class in Nitrousio


I am learning Rails with a tutorial, and your platform is very supportive as my laptop runs on windows, so thanks for giving the possibility to learn to code for free.

I am currently trying to run a bit of ruby code within irb, and I get stuck with this :

2.0.0p247 :001 > Date.today
NoMethodError: undefined method `today' for Date:Class

I checked on ruby API, and there definitely is such a method for Date class, so I guess it is an issue regarding the use of an unix emulator ?

Thanks for your reply,


Solution

  • You need to require 'date', try this in irb...

    require 'date'
    Date.today