fix the rails env bug