Gitlab CI& Rails Postgres崩溃

时间:2017-02-14 10:38:18

标签: ruby-on-rails ruby postgresql gitlab gitlab-ci

我试图在Gitlab CI上配置CI并获得此错误

$ rake db:create
/usr/local/bundle/gems/activesupport-5.0.1/lib/active_support/xml_mini.rb:51: warning: constant ::Fixnum is deprecated
/usr/local/bundle/gems/activesupport-5.0.1/lib/active_support/xml_mini.rb:52: warning: constant ::Bignum is deprecated
could not connect to server: No such file or directory
    Is the server running locally and accepting
    connections on Unix domain socket "/var/run/postgresql/.s.PGSQL.5432"?
Couldn't create database for {"adapter"=>"postgresql", "encoding"=>"unicode", "pool"=>5, "username"=>"runner", "database"=>"ems"}
rake aborted!
PG::ConnectionBad: could not connect to server: No such file or directory
    Is the server running locally and accepting
    connections on Unix domain socket "/var/run/postgresql/.s.PGSQL.5432"?

1 个答案:

答案 0 :(得分:0)

.gitlab-ci.yml中定义的服务是a seperate docker instance而不是本地服务。您需要更新db配置以指向名为postgres

的主机