Continuing from http://groups.google.com/group/rubyonrails-core/browse_frm/thread/f6a655492e571aa2 This is the second time this plugin loading patch was committed and is still broken. I can only reproduce the error running in production mode. Can changeset #5738 please be revert (again). --~--~---------~--~----~------------~-------~--~----~ You received this message because you are subscribed to the Google Groups "Ruby on Rails: Core" group. To post to this group, send email to rubyonrails-core@googlegroups.com To unsubscribe from this group, send email to rubyonrails-core-unsubscribe@googlegroups.com For more options, visit this group at http://groups.google.com/group/rubyonrails-core?hl=en -~----------~----~----~----~------~----~------~--~---
Continuing from http://groups.google.com/group/rubyonrails-core/browse_frm/thread/ f6a655492e571aa2 This is the second time this plugin loading patch was committed and is still broken. I can only reproduce the error running in production mode. Can changeset #5738 please be revert (again). -- Josh Peek http://joshpeek.com/ --~--~---------~--~----~------------~-------~--~----~ You received this message because you are subscribed to the Google Groups "Ruby on Rails: Core" group. To post to this group, send email to rubyonrails-core@googlegroups.com To unsubscribe from this group, send email to rubyonrails-core-unsubscribe@googlegroups.com For more options, visit this group at http://groups.google.com/group/rubyonrails-core?hl=en -~----------~----~----~----~------~----~------~--~---
Michael Koziarski
2006-Dec-19 22:31 UTC
Re: Changeset #5738 Breaks plugins loading (Still)
On 12/20/06, Josh Peek <josh@joshpeek.com> wrote:> > Continuing from > http://groups.google.com/group/rubyonrails-core/browse_frm/thread/ > f6a655492e571aa2 > > This is the second time this plugin loading patch was committed and is > still broken. I can only reproduce the error running in production > mode. > > Can changeset #5738 please be revert (again).What''s the error you receive? The previous one no longer occurs for me in any environment, including production. -- Cheers Koz --~--~---------~--~----~------------~-------~--~----~ You received this message because you are subscribed to the Google Groups "Ruby on Rails: Core" group. To post to this group, send email to rubyonrails-core@googlegroups.com To unsubscribe from this group, send email to rubyonrails-core-unsubscribe@googlegroups.com For more options, visit this group at http://groups.google.com/group/rubyonrails-core?hl=en -~----------~----~----~----~------~----~------~--~---
On Dec 19, 2006, at 4:31 PM, Michael Koziarski wrote:> What''s the error you receive? The previous one no longer occurs for > me in any environment, including production.I get this error locally and on my production server. Yes, I run a production server on edge, :) http://pastie.caboo.se/28648 -- Josh Peek http://joshpeek.com/ --~--~---------~--~----~------------~-------~--~----~ You received this message because you are subscribed to the Google Groups "Ruby on Rails: Core" group. To post to this group, send email to rubyonrails-core@googlegroups.com To unsubscribe from this group, send email to rubyonrails-core-unsubscribe@googlegroups.com For more options, visit this group at http://groups.google.com/group/rubyonrails-core?hl=en -~----------~----~----~----~------~----~------~--~---
Michael Koziarski
2006-Dec-19 22:44 UTC
Re: Changeset #5738 Breaks plugins loading (Still)
> On Dec 19, 2006, at 4:31 PM, Michael Koziarski wrote: > > > What''s the error you receive? The previous one no longer occurs for > > me in any environment, including production. > > I get this error locally and on my production server. > Yes, I run a production server on edge, :) > > http://pastie.caboo.se/28648Can you provide production.rb too? -- Cheers Koz --~--~---------~--~----~------------~-------~--~----~ You received this message because you are subscribed to the Google Groups "Ruby on Rails: Core" group. To post to this group, send email to rubyonrails-core@googlegroups.com To unsubscribe from this group, send email to rubyonrails-core-unsubscribe@googlegroups.com For more options, visit this group at http://groups.google.com/group/rubyonrails-core?hl=en -~----------~----~----~----~------~----~------~--~---
On Dec 19, 2006, at 4:44 PM, Michael Koziarski wrote:> Can you provide production.rb too?Was something new added to the default production config? http://pastie.caboo.se/28654 -- Josh Peek http://joshpeek.com/ --~--~---------~--~----~------------~-------~--~----~ You received this message because you are subscribed to the Google Groups "Ruby on Rails: Core" group. To post to this group, send email to rubyonrails-core@googlegroups.com To unsubscribe from this group, send email to rubyonrails-core-unsubscribe@googlegroups.com For more options, visit this group at http://groups.google.com/group/rubyonrails-core?hl=en -~----------~----~----~----~------~----~------~--~---
On 20/12/2006, at 9:55 AM, Josh Peek wrote:> On Dec 19, 2006, at 4:44 PM, Michael Koziarski wrote: > >> Can you provide production.rb too? > > Was something new added to the default production config? > > http://pastie.caboo.se/28654Nope: http://dev.rubyonrails.org/svn/rails/trunk/railties/ environments/production.rb Have you require''d your paypal library at _the top_ of your environment.rb? -- tim --~--~---------~--~----~------------~-------~--~----~ You received this message because you are subscribed to the Google Groups "Ruby on Rails: Core" group. To post to this group, send email to rubyonrails-core@googlegroups.com To unsubscribe from this group, send email to rubyonrails-core-unsubscribe@googlegroups.com For more options, visit this group at http://groups.google.com/group/rubyonrails-core?hl=en -~----------~----~----~----~------~----~------~--~---
On Dec 19, 2006, at 5:14 PM, Tim Lucas wrote:> Nope: http://dev.rubyonrails.org/svn/rails/trunk/railties/ > environments/production.rb > > Have you require''d your paypal library at _the top_ of your > environment.rb?Removing "Paypal::Notification.ipn_url = .." removes the error. Has the order of loading plugins changed? Do they load after all my custom config? It looks like "/vendor/plugins/*/lib/" has been remove from the path. Every works fine the way I have it on #5737. -- Josh Peek http://joshpeek.com/ --~--~---------~--~----~------------~-------~--~----~ You received this message because you are subscribed to the Google Groups "Ruby on Rails: Core" group. To post to this group, send email to rubyonrails-core@googlegroups.com To unsubscribe from this group, send email to rubyonrails-core-unsubscribe@googlegroups.com For more options, visit this group at http://groups.google.com/group/rubyonrails-core?hl=en -~----------~----~----~----~------~----~------~--~---
On Dec 19, 2006, at 5:32 PM, Josh Peek wrote:> It looks like "/vendor/plugins/*/lib/" has been remove from the path.Ah, this is the problem here. Unit tests still pass and environment has access to plugins. Should I submit the patch?- http://pastie.caboo.se/28668 -- Josh Peek http://joshpeek.com/ --~--~---------~--~----~------------~-------~--~----~ You received this message because you are subscribed to the Google Groups "Ruby on Rails: Core" group. To post to this group, send email to rubyonrails-core@googlegroups.com To unsubscribe from this group, send email to rubyonrails-core-unsubscribe@googlegroups.com For more options, visit this group at http://groups.google.com/group/rubyonrails-core?hl=en -~----------~----~----~----~------~----~------~--~---
On 12/19/06, Josh Peek <josh@joshpeek.com> wrote:> > It looks like "/vendor/plugins/*/lib/" has been remove from the path.We actually just had a patch that removed that line. Why is it necessary for your plugin to operate? Plugin lib directories are added to the load path(s) as each plugin is initialized (see Rails::Initializer#load_plugin), and the line you highlight actually adds ALL plugin lib directories to the load path (*again*). If you could figure out why your application/plugin NEEDS all plugin lib directories to be in the load path twice, that would explain what the real problem is. -- * J * ~ --~--~---------~--~----~------------~-------~--~----~ You received this message because you are subscribed to the Google Groups "Ruby on Rails: Core" group. To post to this group, send email to rubyonrails-core@googlegroups.com To unsubscribe from this group, send email to rubyonrails-core-unsubscribe@googlegroups.com For more options, visit this group at http://groups.google.com/group/rubyonrails-core?hl=en -~----------~----~----~----~------~----~------~--~---
On 12/19/06, Josh Peek <josh@joshpeek.com> wrote:> Can changeset #5738 please be revert (again).For what it''s worth, please don''t revert the whole changeset, as it contains other useful functionality that isn''t relevant to the problem here. If we can''t figure out why there are some dependencies issues, then adding the removed set of duplicate load paths should be sufficient (i.e. reverting the patch from ticket #6842) -- * J * ~ --~--~---------~--~----~------------~-------~--~----~ You received this message because you are subscribed to the Google Groups "Ruby on Rails: Core" group. To post to this group, send email to rubyonrails-core@googlegroups.com To unsubscribe from this group, send email to rubyonrails-core-unsubscribe@googlegroups.com For more options, visit this group at http://groups.google.com/group/rubyonrails-core?hl=en -~----------~----~----~----~------~----~------~--~---
James Adam wrote:> If you could figure out why your application/plugin NEEDS all plugin > lib directories to be in the load path twice, that would explain what > the real problem is.I don''t need everything to be load twice. I need the plugins to be loaded before it reads the bottom of my environment file. This was the behavior before the patch. --~--~---------~--~----~------------~-------~--~----~ You received this message because you are subscribed to the Google Groups "Ruby on Rails: Core" group. To post to this group, send email to rubyonrails-core@googlegroups.com To unsubscribe from this group, send email to rubyonrails-core-unsubscribe@googlegroups.com For more options, visit this group at http://groups.google.com/group/rubyonrails-core?hl=en -~----------~----~----~----~------~----~------~--~---
On 12/20/06, Josh Peek <josh@joshpeek.com> wrote:> > James Adam wrote: > > If you could figure out why your application/plugin NEEDS all plugin > > lib directories to be in the load path twice, that would explain what > > the real problem is. > > I don''t need everything to be load twice. I need the plugins to be > loaded before it reads the bottom of my environment file. This was the > behavior before the patch.Ah. I see the problem. Josh is referring to a Constant in his production.rb environment file which is only available in a plugin. However, because the environment/*.rb files are loaded BEFORE plugins are loaded, none of these constants will be available. This presents a bit of a chicken-and-egg problem, because it makes sense (and certainly seems to be good practice) to add environment-specific configuration in this files, but without effectively ignoring config.plugins while they load, we''ll always have errors like this. Hmm. For 1.2, it seems better to re-add ALL plugins to the load path than try and resolve this tangle. It seems more likely that this could be cleaned up in a release where things are expected to break. I''ve added a patch to Ticket #6856 which re-adds this plugin lib directories to the load path; I''d suggest committing this until a "better" solution to this problem can be provided. -- * J * ~ --~--~---------~--~----~------------~-------~--~----~ You received this message because you are subscribed to the Google Groups "Ruby on Rails: Core" group. To post to this group, send email to rubyonrails-core@googlegroups.com To unsubscribe from this group, send email to rubyonrails-core-unsubscribe@googlegroups.com For more options, visit this group at http://groups.google.com/group/rubyonrails-core?hl=en -~----------~----~----~----~------~----~------~--~---
Sounds good. I have nothing against all the features but everything submited to 1.2 should be backward compatible (unless noted on rails blog). --~--~---------~--~----~------------~-------~--~----~ You received this message because you are subscribed to the Google Groups "Ruby on Rails: Core" group. To post to this group, send email to rubyonrails-core@googlegroups.com To unsubscribe from this group, send email to rubyonrails-core-unsubscribe@googlegroups.com For more options, visit this group at http://groups.google.com/group/rubyonrails-core?hl=en -~----------~----~----~----~------~----~------~--~---
On 20/12/2006, at 11:18 AM, James Adam wrote:> Ah. I see the problem. Josh is referring to a Constant in his > production.rb environment file which is only available in a plugin. > However, because the environment/*.rb files are loaded BEFORE plugins > are loaded, none of these constants will be available. > > This presents a bit of a chicken-and-egg problem, because it makes > sense (and certainly seems to be good practice) to add > environment-specific configuration in this files, but without > effectively ignoring config.plugins while they load, we''ll always have > errors like this.Can''t this be solved with after_initialize? I do this for any non- rails specifics within environment configs: config.after_initialize do SystemPaths.smtp_conf_file = "/etc/conf/smtp.conf" end -- tim --~--~---------~--~----~------------~-------~--~----~ You received this message because you are subscribed to the Google Groups "Ruby on Rails: Core" group. To post to this group, send email to rubyonrails-core@googlegroups.com To unsubscribe from this group, send email to rubyonrails-core-unsubscribe@googlegroups.com For more options, visit this group at http://groups.google.com/group/rubyonrails-core?hl=en -~----------~----~----~----~------~----~------~--~---
Michael Koziarski
2006-Dec-20 00:44 UTC
Re: Changeset #5738 Breaks plugins loading (Still)
> Can''t this be solved with after_initialize? I do this for any non- > rails specifics within environment configs: > > config.after_initialize do > SystemPaths.smtp_conf_file = "/etc/conf/smtp.conf" > endThat''s exactly right. config.after_initialize is there for this reason. Even before the load paths were changed, init.rb still wasn''t fired until after the initializer block had completely run. So if you had a plugin which ''monkeypatched'' some core files in init.rb, those changes weren''t visible in production.rb. -- Cheers Koz --~--~---------~--~----~------------~-------~--~----~ You received this message because you are subscribed to the Google Groups "Ruby on Rails: Core" group. To post to this group, send email to rubyonrails-core@googlegroups.com To unsubscribe from this group, send email to rubyonrails-core-unsubscribe@googlegroups.com For more options, visit this group at http://groups.google.com/group/rubyonrails-core?hl=en -~----------~----~----~----~------~----~------~--~---
On Dec 19, 2006, at 6:37 PM, Tim Lucas wrote:> Can''t this be solved with after_initialize? I do this for any non- > rails specifics within environment configs: > > config.after_initialize do > SystemPaths.smtp_conf_file = "/etc/conf/smtp.conf" > endAwesome. My problem is solved but do we still want to include it with 1.2? You could leave it in edge but remove revert it in the release candidate. -- Josh Peek http://joshpeek.com/ --~--~---------~--~----~------------~-------~--~----~ You received this message because you are subscribed to the Google Groups "Ruby on Rails: Core" group. To post to this group, send email to rubyonrails-core@googlegroups.com To unsubscribe from this group, send email to rubyonrails-core-unsubscribe@googlegroups.com For more options, visit this group at http://groups.google.com/group/rubyonrails-core?hl=en -~----------~----~----~----~------~----~------~--~---
Michael Koziarski
2006-Dec-20 01:22 UTC
Re: Changeset #5738 Breaks plugins loading (Still)
> Awesome. > > My problem is solved but do we still want to include it with 1.2? You > could leave it in edge but remove revert it in the release candidate.I''m not convinced it''s worth pulling from the release. When I added config.after_initialize it was because a plugin I was using defined some constants in init.rb which I was trying to use in production.rb. So anything which is triggered by init.rb wasn''t previously available, your case worked because all it had to do was require a file, more complicated stuff wouldn''t have. What are other people''s take on this? -- Cheers Koz --~--~---------~--~----~------------~-------~--~----~ You received this message because you are subscribed to the Google Groups "Ruby on Rails: Core" group. To post to this group, send email to rubyonrails-core@googlegroups.com To unsubscribe from this group, send email to rubyonrails-core-unsubscribe@googlegroups.com For more options, visit this group at http://groups.google.com/group/rubyonrails-core?hl=en -~----------~----~----~----~------~----~------~--~---
> Can''t this be solved with after_initialize? I do this for any non- > rails specifics within environment configs: > > config.after_initialize do > SystemPaths.smtp_conf_file = "/etc/conf/smtp.conf" > endHow about config.to_prepare for things that need to happen each time the dispatcher is reloaded, such as a call to Liquid::Template.register_tag? This is what bit me, same thing, the Liquid plugin isn''t loaded at the time this runs. --~--~---------~--~----~------------~-------~--~----~ You received this message because you are subscribed to the Google Groups "Ruby on Rails: Core" group. To post to this group, send email to rubyonrails-core@googlegroups.com To unsubscribe from this group, send email to rubyonrails-core-unsubscribe@googlegroups.com For more options, visit this group at http://groups.google.com/group/rubyonrails-core?hl=en -~----------~----~----~----~------~----~------~--~---
On 20/12/2006, at 11:37 AM, Tim Lucas wrote:> > On 20/12/2006, at 11:18 AM, James Adam wrote: > >> Ah. I see the problem. Josh is referring to a Constant in his >> production.rb environment file which is only available in a plugin. >> However, because the environment/*.rb files are loaded BEFORE plugins >> are loaded, none of these constants will be available. >> >> This presents a bit of a chicken-and-egg problem, because it makes >> sense (and certainly seems to be good practice) to add >> environment-specific configuration in this files, but without >> effectively ignoring config.plugins while they load, we''ll always >> have >> errors like this. > > Can''t this be solved with after_initialize? I do this for any non- > rails specifics within environment configs: > > config.after_initialize do > SystemPaths.smtp_conf_file = "/etc/conf/smtp.conf" > endI''ve written about this further, for those that find the Rails initialisation process mysterious: http://toolmantim.com/article/2006/12/27/ environments_and_the_rails_initialisation_process I hope the rdocs for Rails::Initializer and Rails::Configuration are included in api.rubyonrails.org for 1.2, and their rdocs make sense and that are referenced from the rdoc README and/or generated environment templates. -- tim --~--~---------~--~----~------------~-------~--~----~ You received this message because you are subscribed to the Google Groups "Ruby on Rails: Core" group. To post to this group, send email to rubyonrails-core@googlegroups.com To unsubscribe from this group, send email to rubyonrails-core-unsubscribe@googlegroups.com For more options, visit this group at http://groups.google.com/group/rubyonrails-core?hl=en -~----------~----~----~----~------~----~------~--~---