Topic: Rake Task works in development but doesn't oin production

Hi all,

For debugging I reduced the code of the task to to the following:

puts User.exists?  -> true
puts Agent.exists? -> true in development but "uninitialized constant Object::Agent" in production

Code was deployed before, rake RAILS_ENV=production db:migrate' and even rake  RAILS_ENV=production db:schema:load was executed

The application works fine, the problem only appears with the rake task.

class User < ActiveRecord::Base
    has_many :agents
    ...
end

class Agent < ActiveRecord::Base
    belongs_to :user
    ...
end

Can this be a Cache issue?

Thanks in advance

Re: Rake Task works in development but doesn't oin production

sorry, forgot to tell that I'm using rails 3.0.0

Last edited by yngad (2011-04-15 04:14:39)

Re: Rake Task works in development but doesn't oin production

solved:
config.threadsafe! must be disabled, otherwise rake will not perform eager_loading