1

I am using rails with figaro for configuration, database user with the name test. I have a DATABASE_URL in application.yml

DATABASE_URL: "postgresql://localhost/database_name?user=test"

When I run a

rake db:migrate

I get the following error

PG::ConnectionBad: fe_sendauth: no password supplied
Arvind
  • 2,671
  • 1
  • 18
  • 32
user3814030
  • 1,263
  • 3
  • 20
  • 37

2 Answers2

0

Check config/database.yml to ensure your password is wired up for postgresql adapter.

it should look something like this:

default:
  adapter: postgresql
  database: foo
  user: bar
  password: <%= ENV['pg_password'] %>

pg_password should be defined in your figaro config, where it becomes accessible as an environment variable.

random-forest-cat
  • 33,652
  • 11
  • 120
  • 99
0

I just want to emphasize you call the Figaro ENV variables in your .yml using the ERB Syntax :

 username: <%= ENV["PG_USERNAME"] %>
  password: <%= ENV["PG_PASSWORD"] %>

Hope this helps...!

Rai Vu
  • 1,595
  • 1
  • 20
  • 30