Rails:在CircleCI 2.0上耙db:structure:load超时

时间:2018-10-29 22:51:25

标签: ruby-on-rails database postgresql circleci circleci-2.0

当前,运行rake db:schema:load以在CircleCI上设置数据库。从使用schema.rb迁移到structure.sql时,命令已更新为:rake db:structure:load

不幸的是,它似乎挂起并且没有返回:

$ bin/rake db:structure:load --trace
** Invoke db:structure:load (first_time)
** Invoke db:load_config (first_time)
** Execute db:load_config
** Execute db:structure:load
WARNING: terminal is not fully functional

 set_config 
------------

(1 row)

(END)rake aborted!
Interrupt:
<STACK TRACE>
bin/rake:9:in `<main>'
Tasks: TOP => db:structure:load
Too long with no output (exceeded 10m0s)

Found someone else with the same issue on CircleCI,但没有答案。

1 个答案:

答案 0 :(得分:2)

这似乎与psql客户端向终端的期望用户输入的输出有关:

 set_config 
------------

(1 row)

(END)   <--- like from a terminal pager

并非完全正确的解决方案,而是.circleci/config.yml中的解决方法:

jobs:
    build:
        docker:
          - image: MY_APP_IMAGE
            environment:
              PAGER: cat # prevent psql commands using less