Emmett Carpenter


70 Experience
0 Lessons Completed
0 Questions Solved


Thanks for the reply. I'll do this, as the GoRails guide already had me set up almost everything through WSL and it seems simpler than trying to link the Windows version of Postgres to it.

Thanks for the response. I tried using host: as well as host:, which was the address of my device, but this also failed with the following error:

Caused by:
PG::ConnectionBad: could not connect to server: Connection refused
        Is the server running on host "" and accepting
        TCP/IP connections on port 5432?

As the title states, while following the Windows 11 Rails setup guide I found that whenever I run rake db:create it fails with the following error:

PG::ConnectionBad: could not connect to server: No such file or directory
        Is the server running locally and accepting
        connections on Unix domain socket "/var/run/postgresql/.s.PGSQL.5432"?

I know that postgres is running because I can connect to it from Windows command prompt with psql -U postgres. I also made sure to add username: postgres and password: myPassword to database.yml in my new project.

Any ideas?

Screencast tutorials to help you learn Ruby on Rails, Javascript, Hotwire, Turbo, Stimulus.js, PostgreSQL, MySQL, Ubuntu, and more.

© 2023 GoRails, LLC. All rights reserved.