From: Xavier Noria Date: 2010-04-28T18:28:51+09:00 Subject: Re: uninitialized constant ActiveRecord (NameError) On Wed, Apr 28, 2010 at 11:04 AM, Hemant Bhargava wrote: > I am running a script from console line with command as ruby > script/abc.rb. But i am getting error "uninitialized constant > ActiveRecord (NameError)". Why so .. ? > My first line of the script is class- > > CronJobs < ActiveRecord::Base > ... > ... > end If that script belongs to a Rails application run it with script/runner instead: script/runner script/abc.rb On the other hand, if you are using Active Record stand-alone then you need to load it as any other library.