From: Pierre-Charles David Date: 2007-07-02T20:43:23+09:00 Subject: Re: why 1.hour doesn't work? 2007/7/2, Kenneth : > this is a newbie question: > > so if it is in Ruby on Rails, then 1.hour and 1.hour.from_now both > work.... > now then, how come in irb, they both don't work? They're not part of the core language or even the standard library, but added by Rails. Ruby's classes are open, so libraries can add new methods even to core classes (in this cas Numeric). If you want to uses these methods outside of Rails, you need to load the part of Rails which contributes them (in this case ActiveSupport): % irb irb(main):001:0> require 'rubygems' => false irb(main):002:0> require 'active_support' => true irb(main):003:0> 1.hour => 3600 -- http://pcdavid.net/