我使用的是Ubuntu 15.10版。我在终端上键入rails s
后启动的Ruby应用程式,前往0.0.0.0:3000
,我得到的网页上出现以下错误:NoDatabaseError运行Ruby Rails应用程序
ActiveRecord::NoDatabaseError at /
FATAL: database "local-election_development" does not exist Run
$ bin/rake db:create db:migrate
to create your database
当我从终端上键入bin/rake db:create db:migrate
,我得到这个错误:
PG::InsufficientPrivilege: ERROR: permission denied to create database
我发现this answer,但我不知道如何执行ALTER USER new_user CREATEDB;
命令。
我该如何解决这个错误?
输入'psql'后,它会要求输入密码。如果我忘记了,我该如何重置它? – badjr
http://stackoverflow.com/questions/10845998/i-forgot-the-password-i-entered-during-postgres-installation这个答案会帮助你 –