# Help with PostgreSQL and Sustainable Web Development

**URL:** <https://discuss.rubyonrails.org/t/help-with-postgresql-and-sustainable-web-development/82132>\
**Category:** rubyonrails-talk\
**Created:** [January 18, 2023, 1:16pm UTC](https://discuss.rubyonrails.org/t/help-with-postgresql-and-sustainable-web-development/82132 "2023-01-18T13:16:40Z")\
**Posts on this page:** 4\
**Page:** 1

<div class="post-metadata">

**Author:** ![mustdos](https://sea2.discourse-cdn.com/rubyonrails/user_avatar/discuss.rubyonrails.org/mustdos/32/12979_2.png) [@mustdos](https://discuss.rubyonrails.org/u/mustdos)\
**Post date:** [January 18, 2023, 1:16pm UTC](https://discuss.rubyonrails.org/t/help-with-postgresql-and-sustainable-web-development/82132/1 "2023-01-18T13:16:40Z")

</div>

I’m someone with no fast internet connection and would like to install all my stuff minimally, so I did without Docker in that book (Sustainable Web Development).

All went well until I got to page 38 and got this error when I tried to reset db

PG::ConnectionBad: could not translate host name “db” to address: Unknown host

How to solve it?

---

<div class="post-metadata">

**Author:** ![rodrigoargumedo](https://sea2.discourse-cdn.com/rubyonrails/user_avatar/discuss.rubyonrails.org/rodrigoargumedo/32/12747_2.png) [@rodrigoargumedo](https://discuss.rubyonrails.org/u/rodrigoargumedo)\
**Post date:** [January 19, 2023, 2:37pm UTC](https://discuss.rubyonrails.org/t/help-with-postgresql-and-sustainable-web-development/82132/2 "2023-01-19T14:37:45Z")

</div>

```ruby
PG::ConnectionBad: could not translate host name “db” to address: Unknown host

```

This error is saying the application can’t find the database host it’s trying to connect to. It is assumed that you are using a local database, you may have something like this in your `database.yml`:

```ruby
default: &default
  adapter: postgresql
  encoding: unicode
  # For details on connection pooling, see Rails configuration guide
  # https://guides.rubyonrails.org/configuring.html#database-pooling
  pool: <%= ENV.fetch("RAILS_MAX_THREADS") { 5 } %>

```

Enter a new line after `pool` and state the following line:

```ruby
host: localhost # Or another IP address that you want to point.

```

Let me know if you run into additional issues.

---

<div class="post-metadata">

**Author:** ![mustdos](https://sea2.discourse-cdn.com/rubyonrails/user_avatar/discuss.rubyonrails.org/mustdos/32/12979_2.png) [@mustdos](https://discuss.rubyonrails.org/u/mustdos)\
**Post date:** [January 23, 2023, 7:30am UTC](https://discuss.rubyonrails.org/t/help-with-postgresql-and-sustainable-web-development/82132/3 "2023-01-23T07:30:40Z")

</div>

Tried putting that line in default: after pool:\<%= ENV.fetch(“RAILS\_MAX\_THREADS”) { 5 } %\> and it still failed

---

<div class="post-metadata">

**Author:** ![mustdos](https://sea2.discourse-cdn.com/rubyonrails/user_avatar/discuss.rubyonrails.org/mustdos/32/12979_2.png) [@mustdos](https://discuss.rubyonrails.org/u/mustdos)\
**Post date:** [January 23, 2023, 8:57am UTC](https://discuss.rubyonrails.org/t/help-with-postgresql-and-sustainable-web-development/82132/4 "2023-01-23T08:57:35Z")

</div>

Changed my environment variables of .env.development and .env.test from @db to @localhost and it worked!
