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

Posted by Kim Altintop (Guest)
on 16.05.2008 11:24
(Received via mailing list)
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'
<rest of trace skipped>

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
Posted by Fabio Kung (Guest)
on 16.05.2008 13:50
(Received via mailing list)
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 Altintop <kimologe@yahoo.de> wrote:

> <rest of trace skipped>
>
>
> ---------------------------------------------------------------------
> To unsubscribe from this list, please visit:
>
>   http://xircles.codehaus.org/manage_email
>
>
>


--
Fabio Kung
http://www.fabiokung.com

Caelum - Ensino e Soluções em Computação
http://www.caelum.com.br
Posted by Kim Altintop (Guest)
on 21.05.2008 23:16
(Received via mailing list)
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
Posted by Nick Sieger (Guest)
on 22.05.2008 04:20
(Received via mailing list)
On Wed, May 21, 2008 at 4:15 PM, Kim Altintop <kimologe@yahoo.de> 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