# High Performance PostgreSQL for Rails: bin/rails db:reset does not work with docker (Page 58)

**URL:** <https://forum.devtalk.com/t/high-performance-postgresql-for-rails-bin-rails-db-reset-does-not-work-with-docker-page-58/148279>\
**Category:** PragProg Customers\
**Tags:** book-high-performance-postgresql-for-rails, suggestion\
**Created:** [21 March 2024 19:05 UTC](https://forum.devtalk.com/t/high-performance-postgresql-for-rails-bin-rails-db-reset-does-not-work-with-docker-page-58/148279 "2024-03-21T19:05:16Z")\
**Posts on this page:** 3\
**Page:** 1

<div class="post-metadata">

**Author:** ![tothpeter08](https://forum.devtalk.com/user_avatar/forum.devtalk.com/tothpeter08/32/5979_2.png) [@tothpeter08](https://forum.devtalk.com/u/tothpeter08)\
**Post date:** [21 March 2024 19:05 UTC](https://forum.devtalk.com/t/high-performance-postgresql-for-rails-bin-rails-db-reset-does-not-work-with-docker-page-58/148279/1 "2024-03-21T19:05:16Z")

</div>

@andatki

`bin/rails db:reset` doesn’t work if there is no socket file locally which is the case if I’m running Postgres from a Docker container on OSX.

sh db/setup\_test\_database.sh → “psql: error: connection to server on socket “/tmp/.s.PGSQL.5432” failed: No such file or directory”

Add `-h localhost` to the last 3 lines in that file fixed my problem.

---

<div class="post-metadata">

**Author:** ![andatki](https://forum.devtalk.com/user_avatar/forum.devtalk.com/andatki/32/5332_2.png) [@andatki](https://forum.devtalk.com/u/andatki)\
**Post date:** [12 April 2024 02:18 UTC](https://forum.devtalk.com/t/high-performance-postgresql-for-rails-bin-rails-db-reset-does-not-work-with-docker-page-58/148279/2 "2024-04-12T02:18:45Z")

</div>

Thanks for reporting this. In the book readers install PostgreSQL directly on their host machines (Postgres.app or Homebrew), or work with Docker PostgreSQL containers, but issue commands from within them.

I understand though that some developers prefer to run PostgreSQL within Docker, and issue commands from their local machine. Glad you got it figured out so you can do that.

Thanks for reading!

---

<div class="post-metadata">

**Author:** ![andatki](https://forum.devtalk.com/user_avatar/forum.devtalk.com/andatki/32/5332_2.png) [@andatki](https://forum.devtalk.com/u/andatki)\
**Post date:** [12 April 2024 02:18 UTC](https://forum.devtalk.com/t/high-performance-postgresql-for-rails-bin-rails-db-reset-does-not-work-with-docker-page-58/148279/3 "2024-04-12T02:18:51Z")

</div>

Closed on 12 April 2024 02:18 UTC


