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

TheFirefly

I'm new to rails , Some errors occurred when I tried to run bundle exec rake test:prepare , Same question had been asked Click here ,I have included the psql output. Anyone can help? Thank you.

I got flowing errors :

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:
TheFirefly

Thanks RAJ for reminding me to check the database.yml file ,i put a value for username somehow and i forgot it, by default it should be a nil, So i deleted username: "taouan " then run bundle exec rake test:prepare it worked. Alternative way is ALTER DATABASE testp00 OWNER TO "taouan"

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

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

编辑于
0

我来说两句

0条评论
登录后参与评论

相关文章

来自分类Dev

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

来自分类Dev

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

来自分类Dev

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

来自分类Dev

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

来自分类常见问题

ActiveRecord :: StatementInvalid:PG InFailedSqlTransaction

来自分类Dev

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

来自分类Dev

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

来自分类Dev

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

来自分类Dev

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

来自分类Dev

ActiveRecord :: StatementInvalid:Mysql :: Error:“字段列表” Ruby灯具中的未知列“ user_id”

来自分类Dev

ActiveRecord :: StatementInvalid:Mysql2 :: Error:无法删除或更新父行-Rails 4.2.6

来自分类Dev

Getting Table doesn't exist error, but the table does exist (ActiveRecord::StatementInvalid Mysql2::Error: Table doesn't exist)

来自分类Dev

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

来自分类Dev

获取表不存在错误,但表确实存在(ActiveRecord :: StatementInvalid Mysql2 :: Error:表不存在)

来自分类Dev

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

来自分类Dev

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

来自分类Dev

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

来自分类Dev

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

来自分类Dev

rails 4 ActiveRecord :: StatementInvalid

来自分类Dev

rails 4 ActiveRecord :: StatementInvalid

来自分类Dev

购物车/结帐 ActiveRecord::InvalidForeignKey (PG::ForeignKeyViolation: ERROR on Heroku 但不是 Localhost

来自分类Dev

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

来自分类Dev

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

来自分类Dev

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

来自分类Dev

ActiveRecord :: StatementInvalid(找不到表)

来自分类Dev

ActiveRecord :: StatementInvalid(找不到表)

来自分类Dev

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

来自分类Dev

在显示控制器中ActiveRecord :: StatementInvalid

来自分类Dev

ActiveRecord destroy_all引发StatementInvalid

Related 相关文章

  1. 1

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

  2. 2

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

  3. 3

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

  4. 4

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

  5. 5

    ActiveRecord :: StatementInvalid:PG InFailedSqlTransaction

  6. 6

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

  7. 7

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

  8. 8

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

  9. 9

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

  10. 10

    ActiveRecord :: StatementInvalid:Mysql :: Error:“字段列表” Ruby灯具中的未知列“ user_id”

  11. 11

    ActiveRecord :: StatementInvalid:Mysql2 :: Error:无法删除或更新父行-Rails 4.2.6

  12. 12

    Getting Table doesn't exist error, but the table does exist (ActiveRecord::StatementInvalid Mysql2::Error: Table doesn't exist)

  13. 13

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

  14. 14

    获取表不存在错误,但表确实存在(ActiveRecord :: StatementInvalid Mysql2 :: Error:表不存在)

  15. 15

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

  16. 16

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

  17. 17

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

  18. 18

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

  19. 19

    rails 4 ActiveRecord :: StatementInvalid

  20. 20

    rails 4 ActiveRecord :: StatementInvalid

  21. 21

    购物车/结帐 ActiveRecord::InvalidForeignKey (PG::ForeignKeyViolation: ERROR on Heroku 但不是 Localhost

  22. 22

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

  23. 23

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

  24. 24

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

  25. 25

    ActiveRecord :: StatementInvalid(找不到表)

  26. 26

    ActiveRecord :: StatementInvalid(找不到表)

  27. 27

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

  28. 28

    在显示控制器中ActiveRecord :: StatementInvalid

  29. 29

    ActiveRecord destroy_all引发StatementInvalid

热门标签

归档