Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

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"?
like image 743
denqxotl Avatar asked Dec 08 '25 11:12

denqxotl


1 Answers

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

like image 179
Jakub Kania Avatar answered Dec 10 '25 00:12

Jakub Kania