title: Force Rake Task To Run in Specific Rails Environment
body: <p>I need to run a series of Rake tasks from another Rake task. The first three tasks need to be run in the development environment, but the final task needs to be run in the staging environment. The task has a dependency on <code>:environment</code> which causes the Rails development environment to be loaded before the tasks run.</p>
  
  <p>However, I need the final task to be executed in the staging environment.</p>
  
  <p>Passing a <code>RAILS_ENV=staging</code> flag before invoking the rake task is no good as the environment has already loaded at this point and all this will do is set the flag, not load the staging environment.</p>
  
  <p><strong>Is there a way I can force a rake task in a specific environment?</strong></p>