title: Rails 5, Rspec: Environment data not found in the schema
body: <p>After upgrading a Rails app to Rails 5, running RSpec tests gives me the following error:</p>
  
  <pre><code>rails aborted!
  ActiveRecord::NoEnvironmentInSchemaError: 
  
  Environment data not found in the schema. To resolve this issue, run: 
  
      bin/rails db:environment:set RAILS_ENV=test
  </code></pre>
  
  <p>However, that <code>bin</code> does not exist and I can't seem to generate it with <code>bundle binstubs rails</code> or with <code>rake rails:update:bin</code>.</p>
  
  <p>I have also tried:</p>
  
  <pre><code>rails db:environment:set RAILS_ENV=test
  rake db:environment:set RAILS_ENV=test
  </code></pre>
  
  <p>There is a related issue on Github <a href="https://github.com/rails/rails/issues/23279">here</a>.</p>
  
  <p>How can I address this error?</p>