Problem
I configured database.yml
as follows.
and successfully executed rake db:create:primary, rake db:migrate:primary
.
# database.yml
staging:
primary:
adapter: postgis
encoding: utf8
database: app_db
pool: 5
username: user
password: <passwd>
host: <remote_host>
port: 5432
Then, executed rake db:seed
.
but failed with this errors.
rake aborted!
ActiveRecord::ConnectionNotEstablished: 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"?
Caused by:
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"?
Tasks: TOP => db:abort_if_pending_migrations
Why rake db:abort_if_pending_migrations
is try connect to local?
Environment
ruby
ruby 3.0.6p216
rails
rails (6.1.7.4)