# Postgres not started (PG:ConnectionBad error)

On my first running a rails project on my new M1 Macbook Air, I ran into this error when trying to run `rails db:create`&#x20;

`PG::ConnectionBad: could not connect to server: No such file or directory`

As [documented here](https://app.gitbook.com/@briancasel/s/cheatsheet/~/drafts/-MWHCmalrJHBhwxINUOv/rails-1/troubleshooting/pg-connectionbad-error-when-running-local-rails-server), usually, I would run this to fix this error: \``` rm /usr/local/var/postgres/postmaster.pid` ``&#x20;

However that returned that this directory didn't exist.

Here is what I did to fix it:

```
brew reinstall postgresql
```

And then this, to start postgres server.  I think(?) this also sets up my mac to always start the server at login.

```
brew services start postgresql
```

After that, I was able to successfully run `rails db:create`



