0

So for background, I just got a new computer and put Xubuntu 13.04 on it, then proceeded to put on RVM, Ruby, and Rails. I've slowly been adding libs as I run into problems, but can't find the solution to this one.

When running rake db:migrate, I get the following output:

rake db:migraterake aborted!
PG::ConnectionBad: fe_sendauth: no password supplied
/home/erik/.rvm/gems/ruby-2.0.0-p451/gems/activerecord-4.0.1/lib/active_record/connection_adapters/postgresql_adapter.rb:831:in `initialize'
/home/erik/.rvm/gems/ruby-2.0.0-p451/gems/activerecord-4.0.1/lib/active_record/connection_adapters/postgresql_adapter.rb:831:in `new'
/home/erik/.rvm/gems/ruby-2.0.0-p451/gems/activerecord-4.0.1/lib/active_record/connection_adapters/postgresql_adapter.rb:831:in `connect'
/home/erik/.rvm/gems/ruby-2.0.0-p451/gems/activerecord-4.0.1/lib/active_record/connection_adapters/postgresql_adapter.rb:548:in `initialize'
/home/erik/.rvm/gems/ruby-2.0.0-p451/gems/activerecord-4.0.1/lib/active_record/connection_adapters/postgresql_adapter.rb:41:in `new'
/home/erik/.rvm/gems/ruby-2.0.0-p451/gems/activerecord-4.0.1/lib/active_record/connection_adapters/postgresql_adapter.rb:41:in `postgresql_connection'
/home/erik/.rvm/gems/ruby-2.0.0-p451/gems/activerecord-4.0.1/lib/active_record/connection_adapters/abstract/connection_pool.rb:440:in `new_connection'
/home/erik/.rvm/gems/ruby-2.0.0-p451/gems/activerecord-4.0.1/lib/active_record/connection_adapters/abstract/connection_pool.rb:450:in `checkout_new_connection'
/home/erik/.rvm/gems/ruby-2.0.0-p451/gems/activerecord-4.0.1/lib/active_record/connection_adapters/abstract/connection_pool.rb:421:in `acquire_connection'
/home/erik/.rvm/gems/ruby-2.0.0-p451/gems/activerecord-4.0.1/lib/active_record/connection_adapters/abstract/connection_pool.rb:356:in `block in checkout'
/home/erik/.rvm/gems/ruby-2.0.0-p451/gems/activerecord-4.0.1/lib/active_record/connection_adapters/abstract/connection_pool.rb:355:in `checkout'
/home/erik/.rvm/gems/ruby-2.0.0-p451/gems/activerecord-4.0.1/lib/active_record/connection_adapters/abstract/connection_pool.rb:265:in `block in connection'
/home/erik/.rvm/gems/ruby-2.0.0-p451/gems/activerecord-4.0.1/lib/active_record/connection_adapters/abstract/connection_pool.rb:264:in `connection'
/home/erik/.rvm/gems/ruby-2.0.0-p451/gems/activerecord-4.0.1/lib/active_record/connection_adapters/abstract/connection_pool.rb:546:in `retrieve_connection'
/home/erik/.rvm/gems/ruby-2.0.0-p451/gems/activerecord-4.0.1/lib/active_record/connection_handling.rb:79:in `retrieve_connection'
/home/erik/.rvm/gems/ruby-2.0.0-p451/gems/activerecord-4.0.1/lib/active_record/connection_handling.rb:53:in `connection'
/home/erik/.rvm/gems/ruby-2.0.0-p451/gems/activerecord-4.0.1/lib/active_record/migration.rb:863:in `initialize'
/home/erik/.rvm/gems/ruby-2.0.0-p451/gems/activerecord-4.0.1/lib/active_record/migration.rb:764:in `new'
/home/erik/.rvm/gems/ruby-2.0.0-p451/gems/activerecord-4.0.1/lib/active_record/migration.rb:764:in `up'
/home/erik/.rvm/gems/ruby-2.0.0-p451/gems/activerecord-4.0.1/lib/active_record/migration.rb:742:in `migrate'
/home/erik/.rvm/gems/ruby-2.0.0-p451/gems/activerecord-4.0.1/lib/active_record/railties/databases.rake:42:in `block (2 levels) in <top (required)>'
/home/erik/.rvm/gems/ruby-2.0.0-p451/bin/ruby_executable_hooks:15:in `eval'
/home/erik/.rvm/gems/ruby-2.0.0-p451/bin/ruby_executable_hooks:15:in `<main>'
Tasks: TOP => db:migrate
(See full trace by running task with --trace)

I think I've made the common edits to the pg_hba.conf:

# Database administrative login by Unix domain socket
local   all             postgres                                trust

# 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
# Allow replication connections from localhost, by a user with the
# replication privilege.
#local   replication     postgres                                peer
#host    replication     postgres        127.0.0.1/32            md5
#host    replication     postgres        ::1/128                 md5

and database.yml:

development:
  adapter: postgresql
  encoding: unicode
  database: stevenagy
  host: localhost
  pool: 5
  timeout: 5000
  username: localhost
  password:

test:
  adapter: postgresql
  encoding: unicode
  database: stevenagy
  host: localhost
  pool: 5
  timeout: 5000
  username: localhost
  password:
production:
  development:
  adapter: postgresql
  encoding: unicode
  database: stevenagy
  host: localhost
  pool: 5
  timeout: 5000
  username: localhost
  password:

Any advice? Thanks!

1
  • You didn't set a password,so the error. Commented Mar 27, 2014 at 3:45

1 Answer 1

1

There's no password directive in your database.yml entries, but your pg_hba.conf requires md5 password authentication. Specify a password for your connections, use an authentication method in pg_hba.conf that doesn't require a password, or put the passwords in the ~/.pgpass file if you don't want them in revision control.

Sign up to request clarification or add additional context in comments.

2 Comments

I get the same output if I put "trust" for each entry in the pg_hba.conf file.
@user3358307 Then you forgot to pg_ctl reload or SELECT pg_reload_conf() because if there are no md5 entries you can't get that message.

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service and acknowledge you have read our privacy policy.

Start asking to get answers

Find the answer to your question by asking.

Ask question

Explore related questions

See similar questions with these tags.