1

Disclaimer: I'm very new to programming in general, so please excuse my sizeable ignorance. I'm trying to run an application I've written in rails, but when I do, I get the error "fe_sendauth: no password supplied".
Here's my database.yml, I have a feeling it's something in here.

default: &default
    adapter: postgresql
    pool: 5
    timeout: 5000

development:
  <<: *default
    database: url-shortener_development

test:
  <<: *default
  database: url-shortener_test

production:
  <<: *default
  database: url-shortener_production
  username:
  password:
Rubyist
  • 6,486
  • 10
  • 51
  • 86
OsterGuard
  • 43
  • 1
  • 3
  • It means you are not providing the username and password for the development environment. Create a user and set a password for postgres by referring https://help.ubuntu.com/community/PostgreSQL – Amit Badheka May 26 '15 at 06:05
  • Show your `pg_hba.conf` file – rick May 26 '15 at 06:08
  • @rick, here it is, as far as I can tell. Other users seem to have theirs in different locations. `# TYPE DATABASE USER ADDRESS METHOD # "local" is for Unix domain socket connections only local all all trust # IPv4 local connections: host all all 127.0.0.1/32 trust # IPv6 local connections: host all all ::1/128 trust` Sorry about the formatting. – OsterGuard May 26 '15 at 07:49
  • You might have to create new roles in database . Are you able to login to postgresql shell ? – Caffeine Coder May 26 '15 at 07:55
  • @Caffeine Coder No, I've been trying that for the last hour or so, no luck. I must have created a login at some point, but I have absolutely no memory of it. – OsterGuard May 26 '15 at 08:02
  • ok , do you have the username password for the database in local ? – Caffeine Coder May 26 '15 at 08:10
  • You can uninstall postgresql and again install it , this time remember the credentials . Also , there's a nice tool availaible called PgAdmin3 in ubuntu software centre , it's very useful . – Caffeine Coder May 26 '15 at 08:13
  • @CaffeineCoder Yeah, I guess that's what I'll have to do. God, things really start to spiral once you think you can fix something. – OsterGuard May 26 '15 at 08:48

2 Answers2

1

Change this,

local   all             all                                     trust

to,

local   all             all                                     md5

and create a super_user in PostgreSQL with username and password, and add that username and password to your database.yml file

rick
  • 1,675
  • 3
  • 15
  • 28
0

Please do some changes in database.yml

development:

  adapter: postgresql
  encoding: unicode
  database: database-name
  pool: 5
  username: ####  your pg username
  password: ####  your pg password
djadam
  • 649
  • 1
  • 4
  • 20