Set rack_env early enough.

Making sure default environment (development) will be checked when no environment setting is set.

Also removes redundant environment check.