title: uninitialized constant ActiveRecord Model in rake script
body: <p>I'm using rails 2.3.2 with ruby 1.8.7. I got some problems with my rake scripts. It seems it cannot load any activerecord model with production environment at all. It's so weird that is working with development environment. Here is my rake script:</p>
  
  <pre><code>task :indexing, :domain_name, :needs =&gt; :environment do |t, args|
     ActiveRecord::Base.establish_connection(RAILS_ENV)
  
     unless args.domain_name.blank?
        portals = [Portal.find_by_domain_name(args.domain_name)]
     else
        portals = Portal.actives
     end
  end
  </code></pre>
  
  <p>Any suggestions?</p>