1

I have been encountering difficulties in my Rails application while attempting to utilize the Devise gem. Upon installing the gem and executing the necessary commands, I attempted to run rails db:migrate, only to receive the following error message:

rails aborted!
ActiveRecord::ConnectionNotEstablished: connection to server on socket "/tmp/.s.PGSQL.5432" failed: fe_sendauth: no password supplied


Caused by:
PG::ConnectionBad: connection to server on socket "/tmp/.s.PGSQL.5432" failed: fe_sendauth: no password supplied

Tasks: TOP => db:migrate
(See full trace by running task with --trace)

I have attempted to update Postgres to its most recent version, as well as completely reinstalling it, but this it keeps failing, as I am continually asked for a password that I have not set during the installation process.

Note: this problem is not restricted to only my newly created projects. Instead, it is affecting older projects where Postgres had previously been functioning properly. Furthermore, I am unable to access localhost:3000 due to this issue.

If anyone has a solution to this, I'd be really appreciative, as this issue is preventing me to do any kind of work.

Thanks in advance!

I have attempted various methods such as updating, resetting, deleting, and reinstalling Postgres. I have also thoroughly researched the topic and explored various commands recommended by the StackOverflow community, but none of these attempts have successfully resolved the issue.

sonali
  • 762
  • 10
  • 23
  • 1
    Check if you have provided `password` in your `database.yml` – Deepak Mahakale May 12 '23 at 09:18
  • I did check but no, I didn't provide any password. I also tried to add a password myself to see if it could change things, but the problem still remains – Leonardo Genzolini May 12 '23 at 09:30
  • That your new project doesn't work is less interesting than that your old projects stopped working. What changed around the time they stopped working? – jjanes May 12 '23 at 14:22
  • "continually asked for a password that I have not set during the installation process." If you need a password to log in, but one is not set for you, then you can't log in. There is no logic in which PostgreSQL which says "Well, you don't have a password, so here you go, I'll let you in anyway". That would be nuts. – jjanes May 12 '23 at 14:25
  • 2
    Are you able to connect to the interactive terminal with `psql database_name`? Adding database.yml to your post may help. [This one](https://stackoverflow.com/questions/23375740/pgconnectionbad-fe-sendauth-no-password-supplied) is worth a read. – Arctodus May 12 '23 at 21:18

0 Answers0