ActiveRecordConnection from jobs script

Hi,
I make a cron jobs and I would like to use ActiveRecord. but I have this
error:
/System/Library/Frameworks/Ruby.framework/Versions/1.8/usr/lib/ruby/gems/1.8/gems/activerecord-2.3.5/lib/active_record/connection_adapters/abstract/connection_pool.rb:326:in
`retrieve_connection’: ActiveRecord::ConnectionNotEstablished
(ActiveRecord::ConnectionNotEstablished)

Do I have to require something else?

This is what I am already requiring:
require ‘rubygems’
require ‘hpricot’
require ‘open-uri’
require ‘ostruct’
require ‘active_record’

Greg

or thome think like this: ActiveRecord::Base.establish_connection
Ivan N.
[email protected]

Greg Ma wrote:

Hi,
I make a cron jobs and I would like to use ActiveRecord. but I have this
error:
/System/Library/Frameworks/Ruby.framework/Versions/1.8/usr/lib/ruby/gems/1.8/gems/activerecord-2.3.5/lib/active_record/connection_adapters/abstract/connection_pool.rb:326:in
`retrieve_connection’: ActiveRecord::ConnectionNotEstablished
(ActiveRecord::ConnectionNotEstablished)

Do I have to require something else?

This is what I am already requiring:
require ‘rubygems’
require ‘hpricot’
require ‘open-uri’
require ‘ostruct’
require ‘active_record’

Greg

I believe you should be using script/runner.

Best,

Marnen Laibow-Koser
http://www.marnen.org
[email protected]