LoginSignup
10
3

More than 3 years have passed since last update.

rails×Docker導入でのエラー③「PG::ConnectionBad: fe_sendauth: no password supplied」

Posted at

これは単純に、設定しているパスワードと
環境変数で指定したパスワードが一致していないからでした。

docker-compose.yml
  db:
    image: postgres
    ports: 
        - "5432"
    environment:
      - POSTGRES_DB=postgres
      - POSTGRES_USER=postgres
      - POSTGRES_PASSWORD=postgres
    volumes:
      - ./tmp/db:/var/lib/postgresql/data
database.yml
default: &default
  adapter: postgresql
  encoding: unicode
  host: db
  username: postgres
  password: postgres
  pool: 5

development:
  <<: *default
  database: myapp_development

test:
  <<: *default
  database: myapp_test

下記の部分ですね!

docker-compose.yml
      - POSTGRES_PASSWORD=postgres
database.yml
  password: postgres

以上!

10
3
0

Register as a new user and use Qiita more conveniently

  1. You get articles that match your needs
  2. You can efficiently read back useful information
  3. You can use dark theme
What you can do with signing up
10
3