I have Active Support 3.0.3 installed and Rails 3.0.3 with Ruby 1.8.7.
When I try to use
NoMethodError: undefined method 'week' for 1:Fixnum
Since using Rails should handle this automatically I'm going to assume you're trying to add Active Support to a non-Rails script.
Read "How to Load Core Extensions".
Active Support's methods got broken into smaller groups in Rails 3, so we don't end up loading a lot of unneeded stuff with a simple
require 'activesupport'. Now we have to do things like
If you don't care about granularity, you can choose to load bigger chunks. If you want everything in one big gulp use...
rvm 1.9.2 irb -f irb(main):001:0> require 'active_support/all' => true irb(main):002:0> 1.week.ago => 2010-11-14 17:56:16 -0700 irb(main):003:0>
rvm 1.8.7 irb -f irb(main):001:0> require 'rubygems' => true irb(main):002:0> require 'active_support/all' => true irb(main):003:0> 1.week.ago => Sun Nov 14 17:54:19 -0700 2010 irb(main):004:0>