# Postgres connection error on 'bundle exec rails c'

**URL:** <https://meta.discourse.org/t/postgres-connection-error-on-bundle-exec-rails-c/222153>\
**Category:** Self-hosting\
**Created:** [March 28, 2022, 12:24pm UTC](https://meta.discourse.org/t/postgres-connection-error-on-bundle-exec-rails-c/222153 "2022-03-28T12:24:00Z")\
**Posts on this page:** 1\
**Showing post:** 1

<div class="post-metadata">

**Author:** ![helmi](https://sea3.discourse-cdn.com/meta/user_avatar/meta.discourse.org/helmi/32/114772_2.png) [@helmi](https://meta.discourse.org/u/helmi)\
**Post date:** [March 28, 2022, 12:24pm UTC](https://meta.discourse.org/t/postgres-connection-error-on-bundle-exec-rails-c/222153/1 "2022-03-28T12:24:00Z")

</div>

I’m trying to change some forum settings through the console. I didn’t do that a lot yet so I searched for similar questions on the forum.

Unfortunately when executing ‘bundle exec rails c’ i get an error trace that ends with this line

`/var/www/discourse/vendor/bundle/ruby/2.7.0/gems/activerecord-6.1.4.7/lib/active_record/connection_adapters/postgresql_adapter.rb:81:in `rescue in new_client': connection to server on socket "/var/run/postgresql/.s.PGSQL.5432" failed: FATAL: Peer authentication failed for user "discourse" (ActiveRecord::NoDatabaseError)`

Any idea what’s going on there? Forum itself runs fine - just updated to the latest version the other day.

---

_[View the full topic](https://meta.discourse.org/t/postgres-connection-error-on-bundle-exec-rails-c/222153)._
