Each of those blocks represents one environment. Right now if you look you see there is no password for development and test.
development:
<<: *default
database: blog_development
test:
<<: *default
database: blog_test
production:
<<: *default
database: blog_production
username: blog
password: password
I personally set the password and username in the default settings at the top so I only have to write it once. Here is an example.
default: &default
adapter: postgresql
encoding: unicode
username: <%= ENV['DATABASE_USERNAME'] %>
password: <%= ENV['DATABASE_PASSWORD'] %>
# For details on connection pooling, see rails configuration guide
# http://guides.rubyonrails.org/configuring.html#database-pooling
pool: <%= ENV.fetch("RAILS_MAX_THREADS") { 5 } %>
development:
<<: *default
database: DBName_Development
test:
<<: *default
database: DBName_Test
production:
<<: *default
database: DBName_Production
username: username
password: <%= ENV['DATABASE_PASSWORD'] %>
What happens is this line...
<<default
... includes those values in. So now my development and test databases have the username and passwords that I set in the default area. If you look back at yours now there is no username or password getting sent in for your development (and test) database. If you add those values to your default section it should work. In place of my env variables you could just put your values. The values (username and password) are what you use to log in to your database.