我在我的应用程序中使用SQLite3,它需要PostgreSQL,但您仍然可以使用Heroku进行开发。由于Heroku强烈建议不要使用两个不同的数据库,因此我决定改用PostgreSQL进行开发。我安装了gem pg
,还去了PostgreSQL官方网站获取Windows installer,还更改了我的database.yml
。在安装过程中,它需要PostgreSQL的密码,所以我创建了一个。在尝试创建数据库时,为了通过:fe_sendauth: no password supplied
,我必须将pg_hba.conf
文件从使用md5
更改为trust
。
# 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
不过,在去掉它之后,我现在得到了:
$ 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}
我仍然有我的development.sqlite3
和text.sqlite3
,这会是问题所在吗?必须做些什么?
这是我的全部要点:https://gist.github.com/1522188
https://stackoverflow.com/questions/8639424
复制相似问题