title: local_env.yml not loading before initializers
body: <p>I have the following code in my config/application.rb to load some custom local environment variables</p>
  
  <pre><code>    require File.expand_path('../boot', __FILE__)
  
      require 'rails/all'
  
      # Require the gems listed in Gemfile, including any gems
      # you've limited to :test, :development, or :production.
      Bundler.require(*Rails.groups)
  
      module App
  
          ...
  
      config.before_configuration do
        env_file = File.join(Rails.root, 'config', 'local_env.yml')
        YAML.load(File.open(env_file)).each do |key, value|
          ENV[key.to_s] = value
        end if File.exists?(env_file)
      end
    end
  end
  </code></pre>
  
  <p>I am trying to use this with the railsconfig gem, so I can have sensitive information in settings.yml through referencing the ENV hash.
  My settings.yml look like this:</p>
  
  <pre><code>default_request_ttl: 5
  default_request_shared_key_size: 32
  default_request_tunnel_provider: "SoftEther"
  providers:
    soft_ether:
      server: &lt;%= ENV["RSRS.PROVIDERS.SOFT_ETHER.SERVER"] %&gt;
      port: "443"
      admin_hub_password: &lt;%= ENV["RSRS.PROVIDERS.SOFT_ETHER.PASSWORD"] %&gt;
      vpncmd_path: "/usr/local/bin/vpncmd"
  </code></pre>
  
  <p>The problem is that it seems that settings.yml is parsed before the environment variables are set. This way if I run rails console and call the Settings hash, this is what I get:</p>
  
  <pre><code>jruby-9.0.5.0 :007 &gt; Settings
   =&gt; #&lt;Config::Options default_request_ttl=5, default_request_shared_key_size=32, default_request_tunnel_provider="SoftEther", providers=#&lt;Config::Options soft_ether=#&lt;Config::Options server=nil, port="443", vpncmd_path="/usr/local/bin/vpncmd"&gt;&gt;&gt;
  </code></pre>
  
  <p>But after a Settings.reload! the variables are properly set:</p>
  
  <pre><code>jruby-9.0.5.0 :002 &gt; Settings.reload!
   =&gt; #&lt;Config::Options default_request_ttl=5, default_request_shared_key_size=32, default_request_tunnel_provider="SoftEther", providers=#&lt;Config::Options soft_ether=#&lt;Config::Options server="*.*.*.*", port="443", admin_hub_password="***************", vpncmd_path="/usr/local/bin/vpncmd"&gt;&gt;&gt;
  </code></pre>
  
  <p>I already tried putting the local_env load code in the config/environment.rb but the result is the same. Does anyone have a clue of what is happenning?</p>
  
  <p>Thanks in advance,</p>