title: How to load configuration variables in rails via yaml files
body: <p>I am trying to use an environment variable in <code>config/database.yml</code>.</p>
  
  <p>This is my <code>local_env.yml</code>:</p>
  
  <pre><code># Local Environment Variables
  MYSQL_SOCK: "/tmp/mysql.sock"
  </code></pre>
  
  <p>Then I check if it is correct with the <code>rails console</code> and sure enough:</p>
  
  <pre><code>&gt;&gt; irb(main):002:0&gt; ENV["MYSQL_SOCK"]
  =&gt; "/tmp/mysql.sock"
  </code></pre>
  
  <p>However in <code>config/database.yml</code>:</p>
  
  <pre><code>default: &amp;default
    adapter: mysql2
    socket: ENV["MYSQL_SOCK"]
  </code></pre>
  
  <p>I get the following error:</p>
  
  <pre><code>Mysql2::Error: Can't connect to local MySQL server through socket 'ENV["MYSQL_SOCK"]' (2)
  </code></pre>
  
  <p>But...</p>
  
  <pre><code>default: &amp;default
    adapter: mysql2
    socket: "/tmp/mysql.sock"
  </code></pre>
  
  <p><code>works!</code></p>
  
  <p>What is going wrong?</p>