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
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:
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:
host: localhost # Or another IP address that you want to point.