Set Shell Environment before command

In my understanding of unix shell conventions - the environment variables should be before the shell command. I noticed that a rake task that was scoped to be in ENV development or test was getting loaded in a completely different environment.

Pls Review so I can take my catchall hack out of my local rake task :D

thank you!