rspec returns “PG::Error: ERROR: relation ”table_name“ does not exist”

后端 未结 4 922
礼貌的吻别
礼貌的吻别 2021-02-05 20:43

Environment is REE(2011.12) on rvm, rspec 2.8.0, rails 3.0.6, and pg 0.13.2. Using PostgreSQL 8.3.17 on CentOS 5.6. The db:migrate have work correctly. But rspec have got follow

4条回答
  •  既然无缘
    2021-02-05 21:34

    It typically indicates that there is another open PostgreSql connection. To bubble up the right error try % rake db:test:prepare

    Running test prepare showed the following below and when the open connection (PGAdmin in my case) was closed the issue was resolved.

    rake aborted!
    PG::Error: ERROR:  database "xyz_test" is being accessed by other users
    DETAIL:  There are 1 other session(s) using the database.
    : DROP DATABASE IF EXISTS "xyz_test"
    
    Tasks: TOP => db:test:load => db:test:purge
    (See full trace by running task with --trace)
    

提交回复
热议问题