Time Extensions


#1

Ok, I’ve copied the following code from the RoR book:

require ‘rubygems’
require_gem ‘activesupport’

now = Time.now
puts now
puts now.ago(2600)

I get an error on the line: puts now.ago(2600)
(undefined method `ago’ for Mon Dec 05 20:56:24 Central Standard Time
2005:Time)

For the life of me, I cannot seem to see what is wrong.

Any help? Thanks!


#2

That’s because activesupport gem lacks autorequire ‘active_support’
statement.
I’m not sure whether it’s a bug or not. Anyway use these statements:

require ‘rubygems’
require_gem ‘activesupport’
require ‘active_support’

Kent.