how to include activesupport in a ruby script???

At the top of your script do this:

require 'rubygems'
  require 'active_support'


-- Ezra Zygmuntowicz-- Lead Rails Evangelist
-- Engine Yard, Serious Rails Hosting
-- (866) 518-YARD (9273)

And if you need to specify a particular version:

require 'rubygems'
gem 'activesupport', '>=1.4'
require 'active_support'

Note that the name of the gem has no '_' (I beat my head on that one a few weeks ago). The 'gem' method sets up the load path for a version of the gem that meets the requested restriction.


Rob Biedenharn

Please can anyone explain why this works in rails but not in irb ?

require 'active_support'

=> true

NoMethodError: undefined method `beginning_of_day' for Fri Oct 29
14:05:28 +1300 2010:Time
  from (irb):2


Solved now,

require 'active_support/all'

=> true

=> Mon Nov 01 00:00:00 1300 2010

Ben Williams wrote in post #957932: