I'm having trouble with a build of a Rails application for a PostgreSQL 11.2 database.
Here's the .travis.yml
file:
rvm:
- 2.6.1
dist: xenial
services:
- postgresql
addons:
postgresql: "11.2"
apt:
packages:
- postgresql-11
before_script:
- psql --version
- psql -c 'create database kpdotcom_test;' -U postgres
- cp config/database.yml.travis config/database.yml
- bundle exec rake db:schema:load
However, the build fails:
Any suggestions would be gratefully appreciated.
I had this problem too. Here's the config file that fixed it for me:
This script:
language: ruby
rvm: 2.6.2
before_install:
- sudo apt-get update
- sudo apt-get --yes remove postgresql\*
- sudo apt-get install -y postgresql-11 postgresql-client-11
- sudo cp /etc/postgresql/{9.6,11}/main/pg_hba.conf
- sudo service postgresql restart 11
before_script:
- psql --version
- psql -c 'CREATE DATABASE {{your database name here}};' -U postgres
- psql -c 'CREATE ROLE travis SUPERUSER LOGIN CREATEDB;' -U postgres
- cp config/database.yml.travis config/database.yml
script: bundle exec rake spec
services:
- postgresql
addons:
postgresql: "11.2"
If you love us? You can donate to us via Paypal or buy me a coffee so we can maintain and grow! Thank you!
Donate Us With