Frederick Cheung wrote:
> I bet if you switched to production mode it would work. What I think
> is happening is:
> 
> - request calls Tracker.go
> - Rails unloads loaded classes (since we're in dev mode)
> - You threads continue to run trying to use classes that rails has
> unloaded. Chaos ensues.
> 
> Fred

Bingo! Putting my application in production mode allowed me to make 
continual requests. It, however, doesn't solve the problem though.

Problem:
I've got a module (AccessControl) in RAILS_ROOT/lib that extends my 
controllers (which inherit from ResourceController) and adds 
functionality to AuthenticatedSystem.  In development mode, this works 
fine via requests through the browser. However, once I try to consume 
the resources with ActiveResource, the first request succeeds and the 
next request fails with the following error:

ArgumentError (A copy of AccessControl has been removed from the module 
tree but is still active!):
    
/opt/local/lib/ruby/gems/1.8/gems/activesupport-2.1.1/lib/active_support/dependencies.rb:250:in
 
`load_missing_constant'
    
/opt/local/lib/ruby/gems/1.8/gems/activesupport-2.1.1/lib/active_support/dependencies.rb:468:in
 
`const_missing'
    /lib/access_control.rb:122:in `controller_target'
...

I can't figure out why this would work via the browser but not through 
ActiveResource. The only thing that's different, if I understand it 
correctly, are the headers:
    Accept: application/xml
    Content-Type: application/xml

Why would that make a difference? Not only that, the error is 
originating in the class it says it can't find. Does anyone understand 
why this might be the case?
-- 
Posted via http://www.ruby-forum.com/.

--~--~---------~--~----~------------~-------~--~----~
You received this message because you are subscribed to the Google Groups "Ruby 
on Rails: Talk" group.
To post to this group, send email to [email protected]
To unsubscribe from this group, send email to [EMAIL PROTECTED]
For more options, visit this group at 
http://groups.google.com/group/rubyonrails-talk?hl=en
-~----------~----~----~----~------~----~------~--~---

Reply via email to