title: dotenv gem doesn't get variables in Rails 6 or Ruby 2.6.5
body: <p>I was using the <a href="https://github.com/bkeepers/dotenv" rel="noreferrer">dotenv gem</a> to store environmental variables for development in a secrets file. The gem is no longer pulling the variables after upgrading ruby and rails on my computer. To try and track down the cause, and after a while of trying different options, I ended up creating two identical applications with just two differences. The ruby and the rails versions. One app is able to pull the environmental variables, the other returns nil. Any suggestions? </p>
  
  <p><strong>My Setup</strong></p>
  
  <p>Working application has</p>
  
  <pre><code>ruby "2.5.0"
  gem 'rails',        '~&gt; 5.1.6'
  </code></pre>
  
  <p>Non-working app has</p>
  
  <pre><code>ruby "2.6.5"
  gem 'rails',        '~&gt; 6.0.0'
  </code></pre>
  
  <p><strong>What I have tried so far</strong></p>
  
  <ul>
  <li>I read the information on the gem's site and tried adding <code>Dotenv::Railtie.load</code> to my <code>config/application.rb</code> file.</li>
  <li>Also, I tried adding <code>require: 'dotenv/rails-now'</code> in my Gemfile in case it was because of another gem issue. </li>
  <li>I added <code>require 'dotenv/load'</code> to the files needing the variables. </li>
  <li>I added <code>'require dotenv/load'</code> to various places in my <code>config/application.rb</code> file</li>
  </ul>
  
  <p>Each change I did individually and used <a href="https://github.com/deivid-rodriguez/byebug" rel="noreferrer">byebug</a> to check in the terminal if the variable was loaded. And each time the variable was still <code>nil</code>. </p>
  
  <p>Anything that I am missing? Any suggestions? Or should I switch to another gem? I hear that <a href="https://github.com/laserlemon/figaro" rel="noreferrer">figaro</a> may do the same thing, just never used it before. Thank you in advance for your help. </p>