Search code examples
ruby-on-railspostgresqlapiruby-on-rails-5

Rails error when firing up a cloned API - ActiveRecord::ConnectionNotEstablished


As the title says, I clones a rails API. I tried to follow the steps in this article from point 2 onwards https://dev.to/w3ndo/a-checklist-for-setting-up-a-cloned-rails-application-locally-5468 but I keep getting the same error from db:setup onwards.

enter image description here

Please help!

I have tried googling the answer and phoning a friend.

I have tried rails db:setup, rails db:seed, rails db:create, rails db:migrate.

Update: So I found I was getting this error because the db owner was listed as the original owner in the repo but when I typed psql in terminal and located the db, the owner was listed as me.

I was able to change this using PGadmin 4 and type in the original owner as the db owner.


Solution

  • So I found I was getting this error because the db owner was listed as the original owner in the repo but when I typed psql in terminal and located the db, the owner was listed as me.

    I was able to change this using PGadmin 4 and type in the original owner as the db owner.