M
M
micronex2016-07-24 23:39:18
PostgreSQL
micronex, 2016-07-24 23:39:18

rake db:create db:migrate throws an error. The problem is in pg_hba.conf. What options are there?

rake db:create db:migrate
FATAL: no pg_hba.conf entry for host "127.0.0.1", user "ubuntu", database "postgres", SSL on
FATAL: no pg_hba.conf entry for host "127.0.0.1", user "ubuntu", database "postgres",
changed SSL off to trust , added localhost. Doesn't help.
Everything is fine in database.yml.

Answer the question

In order to leave comments, you need to log in

2 answer(s)
M
micronex, 2016-07-25
@micronex

I cleared the cache and restarted Postgre, everything worked)

A
Andrey Andreev, 2016-07-25
@b0nn1e

I'm not sure if this will help, but
/etc/hosts works something like this for me (actually for ubuntu, for the rest xs)
The database.yml config is something like this

default: &default
  adapter: postgresql
  encoding: unicode
  pool: 5

development:
  <<: *default
  database: project_name_development
test:
  <<: *default
  database: project_name_development

production:
  <<: *default
  database: project_name_production

pg_hba.conf
...
local   all             postgres                                peer

# TYPE  DATABASE        USER            ADDRESS                 METHOD

# "local" is for Unix domain socket connections only
local   all             all                                     trust
# IPv4 local connections:
host    all             all             127.0.0.1/32            trust
# IPv6 local connections:
host    all             all             ::1/128                 trust
...

Relevant for local launch

Didn't find what you were looking for?

Ask your question

Ask a Question

731 491 924 answers to any question