Take the 2-minute tour ×
Stack Overflow is a question and answer site for professional and enthusiast programmers. It's 100% free, no registration required.

I am trying to work on a web app developed by someone else on Heroku. After pulling the source code, I installed PostgreSQL 9.3 on my computer.

Tried to import the existing database on Heroku but it did not seem to work:

$ export HEROKU_POSTGRES_IVORY_URL=postgres:///$(user)

Tried using the following settings in my database.yml file:

development:
  adapter: postgresql
  database: app-dev
  host: localhost
  username: user
  password: (password created when installing PostgreSQL)

But this produced the following error when I try to run the app locally:

c:/RailsInstaller/Ruby2.0.0/lib/ruby/gems/2.0.0/gems/activerecord-3.2.18/lib/act
ive_record/connection_adapters/postgresql_adapter.rb:1222:in `initialize': FATAL
:  password authentication failed for user "user" (PG::ConnectionBad)
        from c:/RailsInstaller/Ruby2.0.0/lib/ruby/gems/2.0.0/gems/activerecord-3
.2.18/lib/active_record/connection_adapters/postgresql_adapter.rb:1222:in `new'
        from c:/RailsInstaller/Ruby2.0.0/lib/ruby/gems/2.0.0/gems/activerecord-3
.2.18/lib/active_record/connection_adapters/postgresql_adapter.rb:1222:in `conne
ct'
        from c:/RailsInstaller/Ruby2.0.0/lib/ruby/gems/2.0.0/gems/activerecord-3
.2.18/lib/active_record/connection_adapters/postgresql_adapter.rb:324:in `initia
lize'
        from c:/RailsInstaller/Ruby2.0.0/lib/ruby/gems/2.0.0/gems/activerecord-3
.2.18/lib/active_record/connection_adapters/postgresql_adapter.rb:28:in `new'
        from c:/RailsInstaller/Ruby2.0.0/lib/ruby/gems/2.0.0/gems/activerecord-3
.2.18/lib/active_record/connection_adapters/postgresql_adapter.rb:28:in `postgre
sql_connection'
        from c:/RailsInstaller/Ruby2.0.0/lib/ruby/gems/2.0.0/gems/activerecord-3
.2.18/lib/active_record/connection_adapters/abstract/connection_pool.rb:315:in `
new_connection'
        from c:/RailsInstaller/Ruby2.0.0/lib/ruby/gems/2.0.0/gems/activerecord-3
.2.18/lib/active_record/connection_adapters/abstract/connection_pool.rb:325:in `
checkout_new_connection'
        from c:/RailsInstaller/Ruby2.0.0/lib/ruby/gems/2.0.0/gems/activerecord-3
.2.18/lib/active_record/connection_adapters/abstract/connection_pool.rb:247:in `
block (2 levels) in checkout'
        from c:/RailsInstaller/Ruby2.0.0/lib/ruby/gems/2.0.0/gems/activerecord-3
.2.18/lib/active_record/connection_adapters/abstract/connection_pool.rb:242:in `
loop'
        from c:/RailsInstaller/Ruby2.0.0/lib/ruby/gems/2.0.0/gems/activerecord-3
.2.18/lib/active_record/connection_adapters/abstract/connection_pool.rb:242:in `
block in checkout'
        from c:/RailsInstaller/Ruby2.0.0/lib/ruby/2.0.0/monitor.rb:211:in `mon_s
ynchronize'
        from c:/RailsInstaller/Ruby2.0.0/lib/ruby/gems/2.0.0/gems/activerecord-3
.2.18/lib/active_record/connection_adapters/abstract/connection_pool.rb:239:in `
checkout'
        from c:/RailsInstaller/Ruby2.0.0/lib/ruby/gems/2.0.0/gems/activerecord-3
.2.18/lib/active_record/connection_adapters/abstract/connection_pool.rb:102:in `
block in connection'
        from c:/RailsInstaller/Ruby2.0.0/lib/ruby/2.0.0/monitor.rb:211:in `mon_s
ynchronize'
        from c:/RailsInstaller/Ruby2.0.0/lib/ruby/gems/2.0.0/gems/activerecord-3
.2.18/lib/active_record/connection_adapters/abstract/connection_pool.rb:101:in `
connection'
        from c:/RailsInstaller/Ruby2.0.0/lib/ruby/gems/2.0.0/gems/activerecord-3
.2.18/lib/active_record/connection_adapters/abstract/connection_pool.rb:410:in `
retrieve_connection'
        from c:/RailsInstaller/Ruby2.0.0/lib/ruby/gems/2.0.0/gems/activerecord-3
.2.18/lib/active_record/connection_adapters/abstract/connection_specification.rb
:171:in `retrieve_connection'
        from c:/RailsInstaller/Ruby2.0.0/lib/ruby/gems/2.0.0/gems/activerecord-3
.2.18/lib/active_record/connection_adapters/abstract/connection_specification.rb
:145:in `connection'
        from c:/RailsInstaller/Ruby2.0.0/lib/ruby/gems/2.0.0/gems/activerecord-3
.2.18/lib/active_record/model_schema.rb:310:in `clear_cache!'
        from c:/RailsInstaller/Ruby2.0.0/lib/ruby/gems/2.0.0/gems/activerecord-3
.2.18/lib/active_record/railtie.rb:103:in `block (2 levels) in <class:Railtie>'
        from c:/RailsInstaller/Ruby2.0.0/lib/ruby/gems/2.0.0/gems/activesupport-
3.2.18/lib/active_support/callbacks.rb:418:in `_run__445699908__prepare__2175577
33__callbacks'
        from c:/RailsInstaller/Ruby2.0.0/lib/ruby/gems/2.0.0/gems/activesupport-
3.2.18/lib/active_support/callbacks.rb:405:in `__run_callback'
        from c:/RailsInstaller/Ruby2.0.0/lib/ruby/gems/2.0.0/gems/activesupport-
3.2.18/lib/active_support/callbacks.rb:385:in `_run_prepare_callbacks'
        from c:/RailsInstaller/Ruby2.0.0/lib/ruby/gems/2.0.0/gems/activesupport-
3.2.18/lib/active_support/callbacks.rb:81:in `run_callbacks'
        from c:/RailsInstaller/Ruby2.0.0/lib/ruby/gems/2.0.0/gems/actionpack-3.2
.18/lib/action_dispatch/middleware/reloader.rb:74:in `prepare!'
        from c:/RailsInstaller/Ruby2.0.0/lib/ruby/gems/2.0.0/gems/actionpack-3.2
.18/lib/action_dispatch/middleware/reloader.rb:48:in `prepare!'
        from c:/RailsInstaller/Ruby2.0.0/lib/ruby/gems/2.0.0/gems/railties-3.2.1
8/lib/rails/application/finisher.rb:47:in `block in <module:Finisher>'
        from c:/RailsInstaller/Ruby2.0.0/lib/ruby/gems/2.0.0/gems/railties-3.2.1
8/lib/rails/initializable.rb:30:in `instance_exec'
        from c:/RailsInstaller/Ruby2.0.0/lib/ruby/gems/2.0.0/gems/railties-3.2.1
8/lib/rails/initializable.rb:30:in `run'
        from c:/RailsInstaller/Ruby2.0.0/lib/ruby/gems/2.0.0/gems/railties-3.2.1
8/lib/rails/initializable.rb:55:in `block in run_initializers'
        from c:/RailsInstaller/Ruby2.0.0/lib/ruby/gems/2.0.0/gems/railties-3.2.1
8/lib/rails/initializable.rb:54:in `each'
        from c:/RailsInstaller/Ruby2.0.0/lib/ruby/gems/2.0.0/gems/railties-3.2.1
8/lib/rails/initializable.rb:54:in `run_initializers'
        from c:/RailsInstaller/Ruby2.0.0/lib/ruby/gems/2.0.0/gems/railties-3.2.1
8/lib/rails/application.rb:136:in `initialize!'
        from c:/RailsInstaller/Ruby2.0.0/lib/ruby/gems/2.0.0/gems/railties-3.2.1
8/lib/rails/railtie/configurable.rb:30:in `method_missing'
        from c:/Users/Alison/young-lake-3173/config/environment.rb:5:in `<top (r
equired)>'
        from c:/RailsInstaller/Ruby2.0.0/lib/ruby/gems/2.0.0/gems/activesupport-
3.2.18/lib/active_support/dependencies.rb:251:in `require'
        from c:/RailsInstaller/Ruby2.0.0/lib/ruby/gems/2.0.0/gems/activesupport-
3.2.18/lib/active_support/dependencies.rb:251:in `block in require'
        from c:/RailsInstaller/Ruby2.0.0/lib/ruby/gems/2.0.0/gems/activesupport-
3.2.18/lib/active_support/dependencies.rb:236:in `load_dependency'
        from c:/RailsInstaller/Ruby2.0.0/lib/ruby/gems/2.0.0/gems/activesupport-
3.2.18/lib/active_support/dependencies.rb:251:in `require'
        from c:/Users/Alison/young-lake-3173/config.ru:3:in `block in <main>'
        from c:/RailsInstaller/Ruby2.0.0/lib/ruby/gems/2.0.0/gems/rack-1.4.5/lib
/rack/builder.rb:51:in `instance_eval'
        from c:/RailsInstaller/Ruby2.0.0/lib/ruby/gems/2.0.0/gems/rack-1.4.5/lib
/rack/builder.rb:51:in `initialize'
        from c:/Users/Alison/young-lake-3173/config.ru:in `new'
        from c:/Users/Alison/young-lake-3173/config.ru:in `<main>'
        from c:/RailsInstaller/Ruby2.0.0/lib/ruby/gems/2.0.0/gems/rack-1.4.5/lib
/rack/builder.rb:40:in `eval'
        from c:/RailsInstaller/Ruby2.0.0/lib/ruby/gems/2.0.0/gems/rack-1.4.5/lib
/rack/builder.rb:40:in `parse_file'
        from c:/RailsInstaller/Ruby2.0.0/lib/ruby/gems/2.0.0/gems/rack-1.4.5/lib
/rack/server.rb:200:in `app'
        from c:/RailsInstaller/Ruby2.0.0/lib/ruby/gems/2.0.0/gems/railties-3.2.1
8/lib/rails/commands/server.rb:46:in `app'
        from c:/RailsInstaller/Ruby2.0.0/lib/ruby/gems/2.0.0/gems/rack-1.4.5/lib
/rack/server.rb:304:in `wrapped_app'
        from c:/RailsInstaller/Ruby2.0.0/lib/ruby/gems/2.0.0/gems/rack-1.4.5/lib
/rack/server.rb:254:in `start'
        from c:/RailsInstaller/Ruby2.0.0/lib/ruby/gems/2.0.0/gems/railties-3.2.1
8/lib/rails/commands/server.rb:70:in `start'
        from c:/RailsInstaller/Ruby2.0.0/lib/ruby/gems/2.0.0/gems/railties-3.2.1
8/lib/rails/commands.rb:55:in `block in <top (required)>'
        from c:/RailsInstaller/Ruby2.0.0/lib/ruby/gems/2.0.0/gems/railties-3.2.1
8/lib/rails/commands.rb:50:in `tap'
        from c:/RailsInstaller/Ruby2.0.0/lib/ruby/gems/2.0.0/gems/railties-3.2.1
8/lib/rails/commands.rb:50:in `<top (required)>'
        from script/rails:6:in `require'
        from script/rails:6:in `<main>'

I've been over the instructions on Heroku over and over and cannot seem to find a solution. I am relatively new to this so some pointers would be much appreciated!

I am developing an app with Ruby on Rails and I am using Windows.

share|improve this question

1 Answer 1

I recommend checking the pg_hba.conf file first, which for windows should be located at:

C:\Program Files\PostgreSQL\9.3\data\pg_hba.conf

On the bottom of the file you should see something along the lines of:

# 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

Does your conf file differ greatly from what is above?

  • If you do make any changes to this file remember to restart postgres
share|improve this answer

Your Answer

 
discard

By posting your answer, you agree to the privacy policy and terms of service.

Not the answer you're looking for? Browse other questions tagged or ask your own question.