- Install Docker:
brew install docker # or brew install homebrew/cask/docker
- Start PG in a container:
docker run --name some-postgres -e POSTGRES_PASSWORD=<mysecretpassword> -e POSTGRES_USER=<username> -p <host_port>:5432 -d postgres[:TAG]
Once created, next time you can you
docker start some-postgres
- Update
config/database.yml
:
development:
adapter: postgresql
encoding: unicode
pool: 5
host: localhost
port: <host_port>
password: <mysecretpassword>
database: my_db_development
- Create db:
bin/rails db:create