Report this

What is the reason for this report?

Database connection error on Rails application with postgresql database

Posted on July 4, 2015
Voha

By Voha

Good day! Could You help me with issue after installing RoR image with postgresql - generate model and after it make migration: rake db:migrate RAILS_ENV=production. Get a mistake - “PG:ConnectionBad: fe_sendauth: no password supplied”. What can I do? (export APP_DATABASE_PASSWORD=**** helps only if there is no restart).



This textbox defaults to using Markdown to format your answer.

You can type !ref in this text area to quickly search our full set of tutorials, documentation & marketplace offerings and insert the link!

These answers are provided by our Community. If you find them useful, show some love by clicking the heart. If you run into issues leave a comment, or add your own answer to help others.

Can you verify if the database works outside of the Rails environment?

What happens when you run these commands in console/terminal?

Run a login test:

psql -U postgres

Run a port test:

netstat -nlp | grep 5432

Hello,

I was having the same error, and for me the environment variables wan’t set. It was just a matter of executing “. /etc/default/unicorn” as seem here to properly setup the variables.

After that all started working again.

The developer cloud

Scale up as you grow — whether you're running one virtual machine or ten thousand.

Get started for free

Sign up and get $200 in credit for your first 60 days with DigitalOcean.*

*This promotional offer applies to new accounts only.