On Sat, Feb 5, 2011 at 11:32 PM, tashfeen.ekram
<[email protected]> wrote:

> Ahhh. Now, I understand your comment but this also confuses me.
>
> 1. rake thinking_sphinx:configure
> no prob
>
> 2. rake thinking_sphinx:configure RAILS_ENV=production
> problem
>
> 3. rake db:migrate
> no prob
>
> 4. rake db:migrate RAILS_ENV=production
> no prob
>
> I guess I am confused why the same problem would not surface when
> running command 4.

If you define a rake task that depends on the :environment builtin
task no eager loading is triggered.

> Also, I can run command 2 and change in
> environments/production.rb cache_classes to false (rather than the
> default of true) and then the problem goes away.

Because cache_classes is a necessary condition for eager loading. If
you set cache_classes to false no eager loading will happen (unless
forced of course).

But it is not a sufficient condition: even if cache_classes is true,
db:migrate and friends won't trigger eager loading.

Could you come up with a self-contained minimal application that
reproduces the issue? Eg, an application with one exact model and one
exact file in app/runners/cron or whatever and the plugin installed
under vendor. Put

    puts "loading #{__FILE__}"

at the top of each of them. Then two one-liners that demonstrate the problem.

If you upload a tarball with that I'll have a look at it.

-- 
You received this message because you are subscribed to the Google Groups "Ruby 
on Rails: Talk" group.
To post to this group, send email to [email protected].
To unsubscribe from this group, send email to 
[email protected].
For more options, visit this group at 
http://groups.google.com/group/rubyonrails-talk?hl=en.

Reply via email to