title: Rake spec runs the test suite, rspec spec causes a Mysql2::Error
body: <p>Rails 4.2.5 on OSX 10.11.4, MySQL 5.7.11</p>
  
  <p>Running <code>rake spec</code> runs the test suite (good), <code>rspec spec</code> causes a <code>Mysql2::Error</code> (bad).
  My limited understanding is that <code>rake spec</code> and <code>rspec spec</code>should be doing exactly the same thing. </p>
  
  <p>I am hoping this will be seen by someone who has experienced this before. </p>
  
  <p>This strange behavior is happening after a pull from remote that added a lot of new features developed by a remote team. Now the test suite that I am developing for the application acting very strangely.</p>
  
  <p><code>rspec spec</code> fails with:</p>
  
  <pre><code>…/lib/mysql2/client.rb:107:in `_query': Mysql2::Error: No database selected: SHOW TABLES (ActiveRecord::StatementInvalid)
  </code></pre>
  
  <p>I have seen this error before usually with straight-forward issues in the database.yml file, yet that file hasn’t changed and is referencing the correct databases.</p>
  
  <p>I verified via mysql shell that the test database exists and has all of the expected tables.</p>
  
  <p>The app runs fine in the development environment.</p>
  
  <p>Running <code>rake spec</code> did nothing until I added <code>require "spec-rails"</code> to application.rb which was not necessary before the git pull described above.</p>
  
  <p>Running <code>rake db:test:prepare</code> works smoothly and I verified that it is setting up the schema as expected.</p>
  
  <p>I have dropped and re-created the test database just to make sure.</p>
  
  <p>I have stopped and restarted the mysql server </p>
  
  <p>While <code>rake spec</code> works it is MUCH slower that it was before the pull.</p>