Loading classes is inherently a thread unsafe task - you run into all sorts of race conditions. While rails has mechanisms for loading all code upfront (it does that in production by default), and this is one of the things that config.threadsafe! does. My recollection is that this disabled for rake tasks though - I don't recall the precise reasons though. If all else fails, you could use require_dependency to load all of the classes you'll need ahead of time.
Fred.