Skip to content

Postgres error - could not connect to server: No such file or directory #25137

Answered by weide-zhou
thornomad asked this question in Actions
Discussion options

You must be logged in to vote

Hi @thornomad ,

Thanks for your reply! I forked your repo and did some changes, now the error is gone:

  1. In config/database.yml, change to use below code, use ‘adapter’ & ‘host’ parameter:

    test:
    <<: *default
    database: test_app_6_test
    adapter: postgresql
    host: localhost
    encoding: unicode
    username: <%= ENV[“POSTGRES_USER”] %>
    password: <%= ENV[“POSTGRES_PASSWORD”] %>

  2. The workflow file:

    name: Ruby

    on: [push]

    jobs:
    build:
    runs-on: ubuntu-latest
    services:
    postgres:
    image: postgres:11
    ports:
    - 5432:5432
    env:
    POSTGRES_USER: postgres
    POSTGRES_PASSWORD: postgres
    options: --health-cmd pg_isready --health-interval 10s --health-timeout 5s --health-retries 5

     steps:
       - uses: actions/checkout@v1
    
    • u…

Replies: 4 comments

Comment options

You must be logged in to vote
0 replies
Comment options

You must be logged in to vote
0 replies
Comment options

You must be logged in to vote
0 replies
Answer selected
Comment options

You must be logged in to vote
0 replies
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
2 participants