title: ActiveRecord::NoDatabaseError: FATAL: database "gvpmahesh" does not exist
body: <p>I am trying to run <code>rake test</code> But I am getting this error</p>
  
  <pre><code>rake aborted!
  ActiveRecord::NoDatabaseError: FATAL:  database "gvpmahesh" does not exist
  /home/gvpmahesh/.rvm/gems/ruby-2.2.3/gems/activerecord-4.2.5.1/lib/active_record/connection_adapters/postgresql_adapter.rb:661:in `rescue in connect'
  /home/gvpmahesh/.rvm/gems/ruby-2.2.3/gems/activerecord-4.2.5.1/lib/active_record/connection_adapters/postgresql_adapter.rb:651:in `connect'
  /home/gvpmahesh/.rvm/gems/ruby-2.2.3/gems/activerecord-4.2.5.1/lib/active_record/connection_adapters/postgresql_adapter.rb:242:in `initialize'
  /home/gvpmahesh/.rvm/gems/ruby-2.2.3/gems/activerecord-4.2.5.1/lib/active_record/connection_adapters/postgresql_adapter.rb:44:in `new'
  /home/gvpmahesh/.rvm/gems/ruby-2.2.3/gems/activerecord-4.2.5.1/lib/active_record/connection_adapters/postgresql_adapter.rb:44:in `postgresql_connection'
  /home/gvpmahesh/.rvm/gems/ruby-2.2.3/gems/activerecord-4.2.5.1/lib/active_record/connection_adapters/abstract/connection_pool.rb:438:in `new_connection'
  /home/gvpmahesh/.rvm/gems/ruby-2.2.3/gems/activerecord-4.2.5.1/lib/active_record/connection_adapters/abstract/connection_pool.rb:448:in `checkout_new_connection'
  /home/gvpmahesh/.rvm/gems/ruby-2.2.3/gems/activerecord-4.2.5.1/lib/active_record/connection_adapters/abstract/connection_pool.rb:422:in `acquire_connection'
  /home/gvpmahesh/.rvm/gems/ruby-2.2.3/gems/activerecord-4.2.5.1/lib/active_record/connection_adapters/abstract/connection_pool.rb:349:in `block in checkout'
  /home/gvpmahesh/.rvm/gems/ruby-2.2.3/gems/activerecord-4.2.5.1/lib/active_record/connection_adapters/abstract/connection_pool.rb:348:in `checkout'
  /home/gvpmahesh/.rvm/gems/ruby-2.2.3/gems/activerecord-4.2.5.1/lib/active_record/connection_adapters/abstract/connection_pool.rb:263:in `block in connection'
  /home/gvpmahesh/.rvm/gems/ruby-2.2.3/gems/activerecord-4.2.5.1/lib/active_record/connection_adapters/abstract/connection_pool.rb:262:in `connection'
  /home/gvpmahesh/.rvm/gems/ruby-2.2.3/gems/activerecord-4.2.5.1/lib/active_record/connection_adapters/abstract/connection_pool.rb:571:in `retrieve_connection'
  /home/gvpmahesh/.rvm/gems/ruby-2.2.3/gems/activerecord-4.2.5.1/lib/active_record/connection_handling.rb:113:in `retrieve_connection'
  /home/gvpmahesh/.rvm/gems/ruby-2.2.3/gems/activerecord-4.2.5.1/lib/active_record/connection_handling.rb:87:in `connection'
  /home/gvpmahesh/.rvm/gems/ruby-2.2.3/gems/activerecord-4.2.5.1/lib/active_record/migration.rb:857:in `needs_migration?'
  /home/gvpmahesh/.rvm/gems/ruby-2.2.3/gems/activerecord-4.2.5.1/lib/active_record/migration.rb:396:in `load_schema_if_pending!'
  /home/gvpmahesh/.rvm/gems/ruby-2.2.3/gems/activerecord-4.2.5.1/lib/active_record/migration.rb:411:in `block in maintain_test_schema!'
  /home/gvpmahesh/.rvm/gems/ruby-2.2.3/gems/activerecord-4.2.5.1/lib/active_record/migration.rb:642:in `suppress_messages'
  /home/gvpmahesh/.rvm/gems/ruby-2.2.3/gems/activerecord-4.2.5.1/lib/active_record/migration.rb:416:in `method_missing'
  /home/gvpmahesh/.rvm/gems/ruby-2.2.3/gems/activerecord-4.2.5.1/lib/active_record/migration.rb:411:in `maintain_test_schema!'
  /home/gvpmahesh/.rvm/gems/ruby-2.2.3/gems/railties-4.2.5.1/lib/rails/test_help.rb:19:in `&lt;top (required)&gt;'
  /home/gvpmahesh/.rvm/gems/ruby-2.2.3/gems/activesupport-4.2.5.1/lib/active_support/dependencies.rb:274:in `require'
  /home/gvpmahesh/.rvm/gems/ruby-2.2.3/gems/activesupport-4.2.5.1/lib/active_support/dependencies.rb:274:in `block in require'
  /home/gvpmahesh/.rvm/gems/ruby-2.2.3/gems/activesupport-4.2.5.1/lib/active_support/dependencies.rb:240:in `load_dependency'
  /home/gvpmahesh/.rvm/gems/ruby-2.2.3/gems/activesupport-4.2.5.1/lib/active_support/dependencies.rb:274:in `require'
  /home/gvpmahesh/code/rails/depot/test/test_helper.rb:3:in `&lt;top (required)&gt;'
  /home/gvpmahesh/code/rails/depot/test/controllers/products_controller_test.rb:1:in `require'
  /home/gvpmahesh/code/rails/depot/test/controllers/products_controller_test.rb:1:in `&lt;top (required)&gt;'
  /home/gvpmahesh/.rvm/gems/ruby-2.2.3/gems/railties-4.2.5.1/lib/rails/test_unit/sub_test_task.rb:114:in `require'
  /home/gvpmahesh/.rvm/gems/ruby-2.2.3/gems/railties-4.2.5.1/lib/rails/test_unit/sub_test_task.rb:114:in `block (3 levels) in define'
  /home/gvpmahesh/.rvm/gems/ruby-2.2.3/gems/railties-4.2.5.1/lib/rails/test_unit/sub_test_task.rb:114:in `each'
  /home/gvpmahesh/.rvm/gems/ruby-2.2.3/gems/railties-4.2.5.1/lib/rails/test_unit/sub_test_task.rb:114:in `block (2 levels) in define'
  /home/gvpmahesh/.rvm/gems/ruby-2.2.3/gems/railties-4.2.5.1/lib/rails/test_unit/sub_test_task.rb:113:in `each'
  /home/gvpmahesh/.rvm/gems/ruby-2.2.3/gems/railties-4.2.5.1/lib/rails/test_unit/sub_test_task.rb:113:in `block in define'
  /home/gvpmahesh/.rvm/gems/ruby-2.2.3/gems/railties-4.2.5.1/lib/rails/test_unit/sub_test_task.rb:20:in `invoke_rake_task'
  /home/gvpmahesh/.rvm/gems/ruby-2.2.3/gems/railties-4.2.5.1/lib/rails/test_unit/testing.rake:8:in `block in &lt;top (required)&gt;'
  /home/gvpmahesh/.rvm/gems/ruby-2.2.3/gems/rake-11.2.2/exe/rake:27:in `&lt;top (required)&gt;'
  /home/gvpmahesh/.rvm/gems/ruby-2.2.3/bin/ruby_executable_hooks:15:in `eval'
  /home/gvpmahesh/.rvm/gems/ruby-2.2.3/bin/ruby_executable_hooks:15:in `&lt;main&gt;'
  PG::ConnectionBad: FATAL:  database "gvpmahesh" does not exist
  /home/gvpmahesh/.rvm/gems/ruby-2.2.3/gems/activerecord-4.2.5.1/lib/active_record/connection_adapters/postgresql_adapter.rb:651:in `initialize'
  /home/gvpmahesh/.rvm/gems/ruby-2.2.3/gems/activerecord-4.2.5.1/lib/active_record/connection_adapters/postgresql_adapter.rb:651:in `new'
  /home/gvpmahesh/.rvm/gems/ruby-2.2.3/gems/activerecord-4.2.5.1/lib/active_record/connection_adapters/postgresql_adapter.rb:651:in `connect'
  /home/gvpmahesh/.rvm/gems/ruby-2.2.3/gems/activerecord-4.2.5.1/lib/active_record/connection_adapters/postgresql_adapter.rb:242:in `initialize'
  /home/gvpmahesh/.rvm/gems/ruby-2.2.3/gems/activerecord-4.2.5.1/lib/active_record/connection_adapters/postgresql_adapter.rb:44:in `new'
  /home/gvpmahesh/.rvm/gems/ruby-2.2.3/gems/activerecord-4.2.5.1/lib/active_record/connection_adapters/postgresql_adapter.rb:44:in `postgresql_connection'
  /home/gvpmahesh/.rvm/gems/ruby-2.2.3/gems/activerecord-4.2.5.1/lib/active_record/connection_adapters/abstract/connection_pool.rb:438:in `new_connection'
  /home/gvpmahesh/.rvm/gems/ruby-2.2.3/gems/activerecord-4.2.5.1/lib/active_record/connection_adapters/abstract/connection_pool.rb:448:in `checkout_new_connection'
  /home/gvpmahesh/.rvm/gems/ruby-2.2.3/gems/activerecord-4.2.5.1/lib/active_record/connection_adapters/abstract/connection_pool.rb:422:in `acquire_connection'
  /home/gvpmahesh/.rvm/gems/ruby-2.2.3/gems/activerecord-4.2.5.1/lib/active_record/connection_adapters/abstract/connection_pool.rb:349:in `block in checkout'
  /home/gvpmahesh/.rvm/gems/ruby-2.2.3/gems/activerecord-4.2.5.1/lib/active_record/connection_adapters/abstract/connection_pool.rb:348:in `checkout'
  /home/gvpmahesh/.rvm/gems/ruby-2.2.3/gems/activerecord-4.2.5.1/lib/active_record/connection_adapters/abstract/connection_pool.rb:263:in `block in connection'
  /home/gvpmahesh/.rvm/gems/ruby-2.2.3/gems/activerecord-4.2.5.1/lib/active_record/connection_adapters/abstract/connection_pool.rb:262:in `connection'
  /home/gvpmahesh/.rvm/gems/ruby-2.2.3/gems/activerecord-4.2.5.1/lib/active_record/connection_adapters/abstract/connection_pool.rb:571:in `retrieve_connection'
  /home/gvpmahesh/.rvm/gems/ruby-2.2.3/gems/activerecord-4.2.5.1/lib/active_record/connection_handling.rb:113:in `retrieve_connection'
  /home/gvpmahesh/.rvm/gems/ruby-2.2.3/gems/activerecord-4.2.5.1/lib/active_record/connection_handling.rb:87:in `connection'
  /home/gvpmahesh/.rvm/gems/ruby-2.2.3/gems/activerecord-4.2.5.1/lib/active_record/migration.rb:857:in `needs_migration?'
  /home/gvpmahesh/.rvm/gems/ruby-2.2.3/gems/activerecord-4.2.5.1/lib/active_record/migration.rb:396:in `load_schema_if_pending!'
  /home/gvpmahesh/.rvm/gems/ruby-2.2.3/gems/activerecord-4.2.5.1/lib/active_record/migration.rb:411:in `block in maintain_test_schema!'
  /home/gvpmahesh/.rvm/gems/ruby-2.2.3/gems/activerecord-4.2.5.1/lib/active_record/migration.rb:642:in `suppress_messages'
  /home/gvpmahesh/.rvm/gems/ruby-2.2.3/gems/activerecord-4.2.5.1/lib/active_record/migration.rb:416:in `method_missing'
  /home/gvpmahesh/.rvm/gems/ruby-2.2.3/gems/activerecord-4.2.5.1/lib/active_record/migration.rb:411:in `maintain_test_schema!'
  /home/gvpmahesh/.rvm/gems/ruby-2.2.3/gems/railties-4.2.5.1/lib/rails/test_help.rb:19:in `&lt;top (required)&gt;'
  /home/gvpmahesh/.rvm/gems/ruby-2.2.3/gems/activesupport-4.2.5.1/lib/active_support/dependencies.rb:274:in `require'
  /home/gvpmahesh/.rvm/gems/ruby-2.2.3/gems/activesupport-4.2.5.1/lib/active_support/dependencies.rb:274:in `block in require'
  /home/gvpmahesh/.rvm/gems/ruby-2.2.3/gems/activesupport-4.2.5.1/lib/active_support/dependencies.rb:240:in `load_dependency'
  /home/gvpmahesh/.rvm/gems/ruby-2.2.3/gems/activesupport-4.2.5.1/lib/active_support/dependencies.rb:274:in `require'
  /home/gvpmahesh/code/rails/depot/test/test_helper.rb:3:in `&lt;top (required)&gt;'
  /home/gvpmahesh/code/rails/depot/test/controllers/products_controller_test.rb:1:in `require'
  /home/gvpmahesh/code/rails/depot/test/controllers/products_controller_test.rb:1:in `&lt;top (required)&gt;'
  /home/gvpmahesh/.rvm/gems/ruby-2.2.3/gems/railties-4.2.5.1/lib/rails/test_unit/sub_test_task.rb:114:in `require'
  /home/gvpmahesh/.rvm/gems/ruby-2.2.3/gems/railties-4.2.5.1/lib/rails/test_unit/sub_test_task.rb:114:in `block (3 levels) in define'
  /home/gvpmahesh/.rvm/gems/ruby-2.2.3/gems/railties-4.2.5.1/lib/rails/test_unit/sub_test_task.rb:114:in `each'
  /home/gvpmahesh/.rvm/gems/ruby-2.2.3/gems/railties-4.2.5.1/lib/rails/test_unit/sub_test_task.rb:114:in `block (2 levels) in define'
  /home/gvpmahesh/.rvm/gems/ruby-2.2.3/gems/railties-4.2.5.1/lib/rails/test_unit/sub_test_task.rb:113:in `each'
  /home/gvpmahesh/.rvm/gems/ruby-2.2.3/gems/railties-4.2.5.1/lib/rails/test_unit/sub_test_task.rb:113:in `block in define'
  /home/gvpmahesh/.rvm/gems/ruby-2.2.3/gems/railties-4.2.5.1/lib/rails/test_unit/sub_test_task.rb:20:in `invoke_rake_task'
  /home/gvpmahesh/.rvm/gems/ruby-2.2.3/gems/railties-4.2.5.1/lib/rails/test_unit/testing.rake:8:in `block in &lt;top (required)&gt;'
  /home/gvpmahesh/.rvm/gems/ruby-2.2.3/gems/rake-11.2.2/exe/rake:27:in `&lt;top (required)&gt;'
  /home/gvpmahesh/.rvm/gems/ruby-2.2.3/bin/ruby_executable_hooks:15:in `eval'
  /home/gvpmahesh/.rvm/gems/ruby-2.2.3/bin/ruby_executable_hooks:15:in `&lt;main&gt;'
  Tasks: TOP =&gt; test:run
  (See full trace by running task with --trace)
  </code></pre>
  
  <p>I have this in the database.yml</p>
  
  <pre><code>development: &amp;default
    adapter: postgresql
    encoding: unicode
    username: &lt;%= ENV['DB_USERNAME'] %&gt;
    password: &lt;%= ENV['DB_PASSWORD'] %&gt;
    host: &lt;%= ENV['DB_HOST'] %&gt;
    database: &lt;%= ENV['DB_NAME'] %&gt;
    pool: &lt;%= ENV['DB_POOL'] %&gt;
  
  # Warning: The database defined as "test" will be erased and
  # re-generated from your development database when you run "rake".
  # Do not set this db to the same as development or production.
  test:
    adapter: postgresql
    encoding: unicode
    username: &lt;%= ENV['DB_USERNAME'] %&gt;
    password: &lt;%= ENV['DB_PASSWORD'] %&gt;
    host: &lt;%= ENV['DB_HOST'] %&gt;
    database: &lt;%= ENV['DB_TEST'] %&gt;
    pool: &lt;%= ENV['DB_POOL'] %&gt;
  
  staging:
    &lt;&lt;: *default
  
  production:
    &lt;&lt;: *default
  </code></pre>
  
  <p>The thing is development database seems to work fine. </p>
  
  <p>When I do <code>rake db:create:all</code></p>
  
  <pre><code>depot_development already exists
  depot_test already exists
  depot_development already exists
  depot_development already exists
  </code></pre>
  
  <p>And I have tried <code>bundle exec rake db:create</code> as well <code>bin/rake db:create</code> </p>