Cache sweeper not loaded when packaging using Warbler 0.9.9/JRuby-Rack

Hi all,

after my complaint on his blog, Nick kindly provided a “verbose build”
of JRuby-Rack which now provides stack traces for errors during Rails
startup. Thanks to this, I was able to figure out what prevents my
Rails app from starting (it runs fine when packaged with warbler 0.9.5):

uninitialized constant ActionController::Caching::Sweeper
/private/tmp/Jetty_0_0_0_0_8080_gtr.war__gtr__-az4hp5/webapp/WEB-INF/
gems/gems/activesupport-2.0.2/lib/active_support/dependencies.rb:
263:in `load_missing_constant’

The sweeper is set as an observer in environment.rb (like this:
config.active_record.observers = :my_sweeper), if I remove it
everything else seems to work fine.
As I’m not too familiar with the innards of how Rails magically loads
dependecies, any hints on what’s going wrong here would be greatly
appreciated!

Regards,
Kim


To unsubscribe from this list, please visit:

http://xircles.codehaus.org/manage_email

as Nick pointed in the jetty-rails list, I suspect it has something to
do
with http://jira.codehaus.org/browse/JRUBY-2507

On Fri, May 16, 2008 at 6:23 AM, Kim A. [email protected] wrote:


To unsubscribe from this list, please visit:

http://xircles.codehaus.org/manage_email


Fabio K.

Caelum - Ensino e Soluções em Computação

Found a workaround for my issue: as Nick’s Rack adapter loads
ActionController to hook into the Rails boot sequence, the Sweeper
class won’t get defined because it depends on ActiveRecord being
loaded already. So if I do a simple ‘require “rubygems”; require
“active_record”’ in environment.rb, everything is in order again.
Something like this might also work for the JIRA issue mentioned.

Of course, there might be a cleaner solution – but I’m happy for now 8)

Regards,
Kim

On Wed, May 21, 2008 at 4:15 PM, Kim A. [email protected] wrote:

Found a workaround for my issue: as Nick’s Rack adapter loads
ActionController to hook into the Rails boot sequence, the Sweeper class
won’t get defined because it depends on ActiveRecord being loaded already.
So if I do a simple ‘require “rubygems”; require “active_record”’ in
environment.rb, everything is in order again. Something like this might also
work for the JIRA issue mentioned.
Of course, there might be a cleaner solution – but I’m happy for now 8)

D’oh! Nice find. I shouldn’t be loading action_controller in that way.
I’ll try to find a different way to do it.

Cheers,
/Nick


To unsubscribe from this list, please visit:

http://xircles.codehaus.org/manage_email