我是新來的rails,當我試圖運行時發生了一些錯誤bundle exec rake test:prepare
, 同樣的問題已經被問到Click here,我已經包含了psql輸出。任何人都可以幫忙謝謝。ActiveRecord :: StatementInvalid:PG :: Error:ERROR:必須是數據庫的所有者
我得到了流動錯誤:
rake aborted!
ActiveRecord::StatementInvalid: PG::Error: ERROR: must be owner of database testp00
: DROP DATABASE IF EXISTS "testp00"
/Users/snailwalker/.rvm/gems/ruby-2.0.0-p481/gems/activerecord-4.0.2/lib/active_record/connection_adapters/postgresql/database_statements.rb:128:in `exec'
/Users/snailwalker/.rvm/gems/ruby-2.0.0-p481/gems/activerecord-4.0.2/lib/active_record/connection_adapters/postgresql/database_statements.rb:128:in `block in execute'
/Users/snailwalker/.rvm/gems/ruby-2.0.0-p481/gems/activerecord-4.0.2/lib/active_record/connection_adapters/abstract_adapter.rb:435:in `block in log'
/Users/snailwalker/.rvm/gems/ruby-2.0.0-p481/gems/activesupport-(required)>'
/Users/snailwalker/.rvm/gems/ruby-2.0.0-p481/gems/activerecord-4.0.2/lib/active_record/railties/databases.rake:370:in `block (3 levels) in <top (required)>'
Tasks: TOP => db:test:load => db:test:purge
(See full trace by running task with --trace)
PSQL:
snailwalker=# \l
List of databases
Name | Owner | Encoding | Collate | Ctype | Access privileges
-------------------+-------------+----------+---------+-------+-----------------------------
devep00 | snailwalker | UTF8 | C | UTF-8 |
myapp_development | snailwalker | UTF8 | C | UTF-8 |
myapp_test | snailwalker | UTF8 | C | UTF-8 |
postgres | snailwalker | UTF8 | C | UTF-8 |
snailwalker | snailwalker | UTF8 | C | UTF-8 |
template0 | snailwalker | UTF8 | C | UTF-8 | =c/snailwalker +
| | | | | snailwalker=CTc/snailwalker
template1 | snailwalker | UTF8 | C | UTF-8 | =c/snailwalker +
| | | | | snailwalker=CTc/snailwalker
testp00 | snailwalker | UTF8 | C | UTF-8 |
(8 rows)
databse.yml:
development:
adapter: postgresql
encoding: unicode
database: devep00
pool: 5
username: taouan
password:
test:
adapter: postgresql
encoding: unicode
database: testp00
pool: 5
username: taouan
password:
你可以發佈database.yml – RAJ 2014-09-01 17:59:02
嗨剛發佈,謝謝你c – Snailwalker 2014-09-01 18:01:28
哈哈我只是想通了,有一個用戶名。 「taouan」 – Snailwalker 2014-09-01 18:04:29