denqxotl
denqxotl

Reputation: 101

Gitlab CI & Rails Postgres crash

I'm trying to configure CI on Gitlab CI and get this error

$ 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"?

Upvotes: 3

Views: 1033

Answers (1)

Jakub Kania
Jakub Kania

Reputation: 16487

A service defined in .gitlab-ci.yml is a seperate docker instance not a local service. You need to update your db configuration to point to a host named postgres

Upvotes: 1

Related Questions