Added environment check to rake tasks