2.3.2 render :text dependency bug

Hi all,

Has there been any progress on the issue with render procs not handling dependencies right in 2.3.2 - or any suggestions on how to work around it?

Jeff reported it here:   http://groups.google.com/group/rubyonrails-core/browse_frm/thread/675477c3fb23bf2

and it's also documented at:   #2546 render :text => Proc - Ruby on Rails - rails   http://groups.google.com/group/rubyonrails-talk/browse_thread/thread/0d1dac35f2f9492a   opportunity__cost: Issues with RoR streaming from controller

Typically it's manifested in an error like this:

"ERROR ArgumentError: A copy of AmfController has been removed from the module tree but is still active!"

I work on the OpenStreetMap (www.openstreetmap.org) online editor and would like to use this to stream map data back to the client as it's fetched. We updated to 2.3.2 the other week, so at present we have to assemble all the data in memory before sending it back as a single chunk, which is less cool.

cheers Richard

"ERROR ArgumentError: A copy of AmfController has been removed from the module tree but is still active!"

Just to be clear, this only happens in development mode right?

It's pretty-much an unavoidable side-effect of the reloading code. You either need to turn off reloading for your controllers (adding app/controllers to the load once paths) or turn ON reloading for your plugins.

Chances are that it's safe for us now to turn on reloading for all the models and controllers in your plugins.

> "ERROR ArgumentError: A copy of AmfController has been removed from > the module tree but is still active!"

Just to be clear, this only happens in development mode right?

Yep, fine in production.

It's pretty-much an unavoidable side-effect of the reloading code. You either need to turn off reloading for your controllers (adding app/controllers to the load once paths) or turn ON reloading for your plugins.

Ok. I don't really want to play with the config for the whole site (this is just one smallish part of it) so I'll probably refactor my output code so it streams in production, but buffers in development. It's a shame as this was ok in 2.2 AFAIK, but understood you've doubtless got good reasons for the new way of doing things. :slight_smile:

cheers Richard

Ok. I don't really want to play with the config for the whole site (this is just one smallish part of it) so I'll probably refactor my output code so it streams in production, but buffers in development. It's a shame as this was ok in 2.2 AFAIK, but understood you've doubtless got good reasons for the new way of doing things. :slight_smile:

The reloading was moved around to support rack access to our sessions (which can contain reloadable objects).

Making your plugin controllers reload, should fix it just fine.