I am using Heroku for my application and it requires PostgreSQL but you can still use SQLite3 for development. Since Heroku strongly advised against having 2 different databases I decided to change to PostgreSQL for development. I installed the gem pg
and also went to the official PostgreSQL site to get the Windows installer and also changed my database.yml
. During installation it requires a password for PostgreSQL so I made one.
I had to change the pg_hba.conf
file from using md5
to trust
in order get past: fe_sendauth: no password supplied
when trying to create the database.
# TYPE DATABASE USER ADDRESS METHOD
# IPv4 local connections:
host all all 127.0.0.1/32 trust # was md5
# IPv6 local connections:
host all all ::1/128 trust # was md5
# Allow replication connections from localhost, by a user with the
# replication privilege.
#host replication postgres 127.0.0.1/32 trust
#host replication postgres ::1/128 trust
After getting rid of that though, I now get this:
$ rake db:create
(in C:/app)
FATAL: role "User" does not exist
Couldn't create database for {"adapter"=>"postgresql", "encoding"=>"utf8",
"database"=>"app_test", "pool"=>5, "username"=>nil, "password"=>nil}
I do still have my development.sqlite3
and text.sqlite3
present, could that be the issue? What must be done?
Here is my full gist: https://gist.github.com/1522188
See Question&Answers more detail:
os 与恶龙缠斗过久,自身亦成为恶龙;凝视深渊过久,深渊将回以凝视…