Fixed Rails env reading for 3.x