title: Rails credentials not working on travis CI - undefined method `[]' for nil:NilClass
body: <p>Im using Rails credentials to store sensitive information on my app. locally it works fine, by calling <code>Rails.application.credentials[Rails.env.to_sym][:key_secret]</code> for example.</p>
  <p>my credentials are stored as:</p>
  <pre><code>test:
    key_secret: &lt;key&gt;
  development:
    key_secret: &lt;key&gt;
  </code></pre>
  <p>Travis doesnt pick this information, when tests start running, then it beaks the build.</p>
  <pre><code>Failure/Error: HMAC_SECRET = Rails.application.credentials[Rails.env.to_sym][:key_secret]
  NoMethodError:
    undefined method `[]' for nil:NilClass
  </code></pre>
  <p>What I did:</p>
  <ul>
  <li>I ran <code>travis encrypt RAILS_MASTER_KEY='cat config/master.key' --add env</code>  this added an encryption key to my <code>.travis.yml</code> file.</li>
  <li>Commited it to the (private)repo, and then added my <code>master.key</code> for decryption, on travis enviroment variables sections as <code>RAILS_MASTER_KEY</code></li>
  </ul>
  <p>Nothing changed, I debugged some lines on travis and got:</p>
  <pre><code>:test # Rails.env.to_sym
  #&lt;ActiveSupport::EncryptedConfiguration:0x0000558fe0675870 @key_path=#&lt;Pathname:/home/api/limpar/current/config/master.key&gt;, @content_path=#&lt;Pathname:/home/api/limpar/current/config/credentials.yml.enc&gt;, @env_key=&quot;RAILS_MASTER_KEY&quot;, @raise_if_missing_key=false&gt; #Rails.application.credentials
  </code></pre>
  <p>Anything else I can test to make it work on Travis CI?</p>