Topic: Error when using script/performance/request

I'm trying to run some performance testing using script/performance/request. However I am having a problem:

ArgumentError (A copy of AuthenticatedSystem has been removed from the module tree but is still active!):
    /Library/Ruby/Gems/1.8/gems/activesupport-2.0.2/lib/active_support/dependencies.rb:237:in `load_missing_constant'
    /Library/Ruby/Gems/1.8/gems/activesupport-2.0.2/lib/active_support/dependencies.rb:453:in `const_missing'
    /lib/authenticated_system.rb:53:in `autologin'

Having done some experimentation with making my request script take different routes though the application I find that its a different line in /lib/authenticated_system.rb that is causing the problem, and it always seems to be the first time that one of my application models are called from authenticated_system that the problem is caused.

From my research so far I think this is something to do with the order of dependency loading, and that somehow the main rails dependency ordering system is not working or not being used. However I am at a loss as to how to fix the problem. Does anyone have any suggestions