ActiveRecord :: StatementInvalid:PG ::错误:错误:必须是数据库的所有者

萤火虫

我是Rails的新手,尝试运行时发生了一些错误,有人bundle exec rake test:prepare问了同样的问题单击此处,我包含了psql输出。有人可以帮忙吗?谢谢你。

我遇到了错误:

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:
萤火虫

感谢RAJ提醒我检查database.yml文件,我以某种方式为用户名设置了一个值,但我忘记了它,默认情况下它应该为nil,所以我删除了用户名:“ taouan”,然后运行了bundle exec rake test:prepare它。另一种方法是ALTER DATABASE testp00 OWNER TO "taouan"

本文收集自互联网,转载请注明来源。

如有侵权,请联系[email protected] 删除。

编辑于
0

我来说两句

0条评论
登录后参与评论

相关文章

来自分类常见问题

ActiveRecord :: StatementInvalid:PG InFailedSqlTransaction

来自分类Dev

ActiveRecord :: StatementInvalid(PG :: SyntaxError:错误:“或”附近的语法错误。

来自分类Dev

ActiveRecord :: StatementInvalid(PG :: UndefinedTable:错误:关系“ guestbooks”不存在

来自分类Dev

ActiveRecord::StatementInvalid: PG::InternalError: ERROR: 解析错误 - 无效几何

来自分类Dev

ActiveRecord :: StatementInvalid-PG :: CharacterNotInRepertoire:错误:编码“ UTF8”的字节序列无效

来自分类Dev

ActiveRecord :: StatementInvalid:PG :: NumericValueOutOfRange:错误:值“ 150000200000”超出整数类型的范围

来自分类Dev

ActiveRecord :: StatementInvalid(PG :: UndefinedTable:错误:关系“ spree_orders”不存在

来自分类Dev

PostgreSQL ActiveRecord::StatementInvalid: PG::GroupingError: ERROR: 必须出现在 GROUP BY 中

来自分类Dev

Rails postgres错误:ActiveRecord :: StatementInvalid异常:PG :: AmbiguousColumn:错误:列引用“ sample_id”不明确

来自分类Dev

Rails 4.1。Heroku ActiveRecord :: StatementInvalid(PG :: UndefinedFunction:错误:运算符不存在:数字-字符变化

来自分类Dev

瑞克任务中收到“ ActiveRecord :: StatementInvalid:PG :: ConnectionBad:PQconsumeInput()无法从服务器接收数据:连接超时”

来自分类Dev

ActiveRecord::StatementInvalid: PG::Error: ERROR: must be owner of database

来自分类Dev

ActiveRecord::StatementInvalid (PG::InvalidDatetimeFormat: ERROR: 类型日期的无效输入语法:""

来自分类Dev

在带有Postgresql的Rails应用程序中使用布尔字段时,为什么会收到ActiveRecord :: StatementInvalid:PG :: SyntaxError:错误?

来自分类Dev

水豚错误ActiveRecord :: StatementInvalid:SQLite3 :: BusyException:数据库已锁定

来自分类Dev

Heroku + Rails + PG:ActiveRecord :: StatementInvalid(PG :: ConnectionBad:PQconsumeInput()SSL连接已意外关闭

来自分类Dev

createdb / pg_restore 有错误:必须是扩展的所有者

来自分类Dev

Heroku上的Rails 4应用上的随机ActiveRecord :: StatementInvalid错误

来自分类Dev

ActiveRecord::StatementInvalid: Mysql2::Error: 重命名错误

来自分类Dev

ActiveRecord :: StatementInvalid(PG :: Error:ERROR:值对于类型字符变化而言太长(255)

来自分类Dev

ActiveRecord :: StatementInvalid(PG :: Error:ERROR:值对于类型字符变化而言太长(255)

来自分类Dev

rails 4 ActiveRecord :: StatementInvalid

来自分类Dev

rails 4 ActiveRecord :: StatementInvalid

来自分类Dev

ActiveRecord :: StatementInvalid(找不到表)

来自分类Dev

ActiveRecord :: StatementInvalid(找不到表)

来自分类Dev

rails:HABTM和ActiveRecord错误(PG :: UndefinedTable:错误:缺少FROM ...)

来自分类Dev

在模型类上使用“ joins”方法时,为什么会收到ActiveRecord :: StatementInvalid错误?

来自分类Dev

ActiveRecord::Enum - PG::InvalidTextRepresentation:错误:整数输入语法无效:

来自分类Dev

ActiveRecord :: StatementInvalid-SQLite3 :: SQLException:没有这样的列

Related 相关文章

  1. 1

    ActiveRecord :: StatementInvalid:PG InFailedSqlTransaction

  2. 2

    ActiveRecord :: StatementInvalid(PG :: SyntaxError:错误:“或”附近的语法错误。

  3. 3

    ActiveRecord :: StatementInvalid(PG :: UndefinedTable:错误:关系“ guestbooks”不存在

  4. 4

    ActiveRecord::StatementInvalid: PG::InternalError: ERROR: 解析错误 - 无效几何

  5. 5

    ActiveRecord :: StatementInvalid-PG :: CharacterNotInRepertoire:错误:编码“ UTF8”的字节序列无效

  6. 6

    ActiveRecord :: StatementInvalid:PG :: NumericValueOutOfRange:错误:值“ 150000200000”超出整数类型的范围

  7. 7

    ActiveRecord :: StatementInvalid(PG :: UndefinedTable:错误:关系“ spree_orders”不存在

  8. 8

    PostgreSQL ActiveRecord::StatementInvalid: PG::GroupingError: ERROR: 必须出现在 GROUP BY 中

  9. 9

    Rails postgres错误:ActiveRecord :: StatementInvalid异常:PG :: AmbiguousColumn:错误:列引用“ sample_id”不明确

  10. 10

    Rails 4.1。Heroku ActiveRecord :: StatementInvalid(PG :: UndefinedFunction:错误:运算符不存在:数字-字符变化

  11. 11

    瑞克任务中收到“ ActiveRecord :: StatementInvalid:PG :: ConnectionBad:PQconsumeInput()无法从服务器接收数据:连接超时”

  12. 12

    ActiveRecord::StatementInvalid: PG::Error: ERROR: must be owner of database

  13. 13

    ActiveRecord::StatementInvalid (PG::InvalidDatetimeFormat: ERROR: 类型日期的无效输入语法:""

  14. 14

    在带有Postgresql的Rails应用程序中使用布尔字段时,为什么会收到ActiveRecord :: StatementInvalid:PG :: SyntaxError:错误?

  15. 15

    水豚错误ActiveRecord :: StatementInvalid:SQLite3 :: BusyException:数据库已锁定

  16. 16

    Heroku + Rails + PG:ActiveRecord :: StatementInvalid(PG :: ConnectionBad:PQconsumeInput()SSL连接已意外关闭

  17. 17

    createdb / pg_restore 有错误:必须是扩展的所有者

  18. 18

    Heroku上的Rails 4应用上的随机ActiveRecord :: StatementInvalid错误

  19. 19

    ActiveRecord::StatementInvalid: Mysql2::Error: 重命名错误

  20. 20

    ActiveRecord :: StatementInvalid(PG :: Error:ERROR:值对于类型字符变化而言太长(255)

  21. 21

    ActiveRecord :: StatementInvalid(PG :: Error:ERROR:值对于类型字符变化而言太长(255)

  22. 22

    rails 4 ActiveRecord :: StatementInvalid

  23. 23

    rails 4 ActiveRecord :: StatementInvalid

  24. 24

    ActiveRecord :: StatementInvalid(找不到表)

  25. 25

    ActiveRecord :: StatementInvalid(找不到表)

  26. 26

    rails:HABTM和ActiveRecord错误(PG :: UndefinedTable:错误:缺少FROM ...)

  27. 27

    在模型类上使用“ joins”方法时,为什么会收到ActiveRecord :: StatementInvalid错误?

  28. 28

    ActiveRecord::Enum - PG::InvalidTextRepresentation:错误:整数输入语法无效:

  29. 29

    ActiveRecord :: StatementInvalid-SQLite3 :: SQLException:没有这样的列

热门标签

归档