Lighthouse has a new layout. Prefer the old one? Return to the old layout, and switch back any time from the link at the top of each page.

This project is archived and is in readonly mode.

config.cache_classes = true causes MissingSourceFile error

#1929

When I run my Rails 2.2.2 app in production mode and config.cache_classes = true, I get the following error message:

c:/Ruby/lib/ruby/gems/1.8/gems/polyglot-0.2.3/lib/polyglot.rb:40:in load': Failed to load c:/Projects/au/app/models/member_mailer using extensions rb, treetop, tt (MissingSourceFile) from c:/Ruby/lib/ruby/gems/1.8/gems/polyglot-0.2.3/lib/polyglot.rb:56:inrequire' from C:/Projects/avatarsunited.com_new/vendor/rails/activesupport/lib/active_support/dependencies.rb:155:in require' from C:/Projects/avatarsunited.com_new/vendor/rails/activesupport/lib/active_support/dependencies.rb:262:inrequire_or_load' from C:/Projects/avatarsunited.com_new/vendor/rails/activesupport/lib/active_support/dependencies.rb:221:in depend_on' from C:/Projects/avatarsunited.com_new/vendor/rails/activesupport/lib/active_support/dependencies.rb:133:inrequire_dependency' from C:/Projects/avatarsunited.com_new/config/../vendor/rails/railties/lib/initializer.rb:368:in load_application_classes' from C:/Projects/avatarsunited.com_new/config/../vendor/rails/railties/lib/initializer.rb:367:ineach' from C:/Projects/avatarsunited.com_new/config/../vendor/rails/railties/lib/initializer.rb:367:in load_application_classes' ... 10 levels... from c:/Ruby/lib/ruby/1.8/irb/init.rb:250:inload_modules' from c:/Ruby/lib/ruby/1.8/irb/init.rb:21:in setup' from c:/Ruby/lib/ruby/1.8/irb.rb:54:instart' from c:/Ruby/bin/irb:13

The error only occurs for my mailer (ActionMailer::Base) classes whenever cache_classes is set to true.

Any ideas what is wrong?

Reported by Fredrik Björk · February 10th, 2009 @ 01:04 PM

State: invalid
Milestone: 2.x
Assigned to: nobody
Importance: none

Activity

  1. Scott Taylor
    Scott Taylor

    Probably some weird conflicting setup between rails and polyglot. Both swap out Kernel#require (rails does it for loading per request, and polyglot does it for .treetop files).

    I found polyglot quite buggy in the past, so I'd look for issues there.

    February 11th, 2009 @ 08:04 AM

  2. Tyler Montgomery
    Tyler Montgomery

    As a work around just require actionmailer and your ActionMailer class in environment.rb

    This will load your ActionMailer class before polyglot tries to require it.

    http://gist.github.com/69116

    February 23rd, 2009 @ 07:17 PM

  3. DHH
    DHH
    • State changed from new to invalid

    Seems to be related to polygot. Please do raise it over there.

    February 27th, 2009 @ 01:53 PM