On Dec 12, 2007 2:21 AM, James Adam <[EMAIL PROTECTED]> wrote:

> If your plugin hasn't been loaded yet, are you sure it ever loads?


Yep.  Everything works perfectly except map.from_plugin...

Is it working for other people?

Routing is not initialized until *after* all the plugins have been
> loaded (see line 105 vs 114 of initializer.rb), so it doesn't seem to
> make sense that your plugin wouldn't be in the Engines.plugins
> structure. Does it definitely have a lib and/or init.rb file?
>

It had a lib but no init.rb.  Adding an empty init.rb didn't fix the
problem.

Regarding your implementation ideas, they would side-step the plugin
> loading process. I'd consider making Routes#from_plugin do nothing if
> the plugin could not be found, since that would gracefully work as you
> removed plugins from config.plugins, but that still wouldn't help your
> problem.
>
> The key here is why your plugin isn't present in Engines.plugins at
> the point the routes file is loaded. Could you pepper the init.rb
> files in your app with puts statements so we can trace what's going
> on?
>

Here's what I see if I have my workaround in place (just starting
script/console).  Added some print statements to initializer.rb too:

$ script/console
Loading development environment (Rails 2.0.1)
load_environment
load_plugins
Engines init.rb called
Engines.init complete
My engine's init.rb called
initialize_routing
after_initialize
>>

Without the workaround in place:

$ script/console
Loading development environment (Rails 2.0.1)
load_environment
load_plugins
Engines init.rb called
Engines.init complete
/Users/tony/src/clickcaster/vendor/plugins/engines/lib/engines/rails_extensions/routing.rb:69:in
`from_plugin':NoMethodError: You have a nil object when you didn't expect
it!

So it's dying somewhere in load_plugins, before my engine's init.rb gets
loaded...

I'll keep digging...

-- 
Tony Arcieri
ClickCaster, Inc.
[EMAIL PROTECTED]
_______________________________________________
Engine-Developers mailing list
[email protected]
http://lists.rails-engines.org/listinfo.cgi/engine-developers-rails-engines.org

Reply via email to