Revert "Merge pull request #10961 from wangjohn/changing_rails_env_config"

This reverts commit 7098d6c9ab28931acc9562a00037567609f9e529, reversing
changes made to 9ec2e2ee91568af24e09760a6de2890b89c33f56.
This make some tests fail /cc @wangjohn