# How can I connect with postgresql using rails?

**URL:** <https://www.ruby-forum.com/t/how-can-i-connect-with-postgresql-using-rails/121476>\
**Category:** Rails\
**Created:** [November 28, 2007, 10:34am UTC](https://www.ruby-forum.com/t/how-can-i-connect-with-postgresql-using-rails/121476 "2007-11-28T10:34:32Z")\
**Posts on this page:** 2\
**Page:** 1

<div class="post-metadata">

**Author:** ![vellingiri](https://www.ruby-forum.com/letter_avatar_proxy/v4/letter/v/5fc32e/32.png) [@vellingiri](https://www.ruby-forum.com/u/vellingiri)\
**Post date:** [November 28, 2007, 10:34am UTC](https://www.ruby-forum.com/t/how-can-i-connect-with-postgresql-using-rails/121476/1 "2007-11-28T10:34:32Z")

</div>

Dear Friends,  
I am a new of ruby on rails.  
In my server mqsql is not installed,instead of mysql I am  
having the postgresql.  
How can I connect with postgresql using rails ?  
Please anyone help me to study further details.

with deep regards,  
S.Vellingiri

---

<div class="post-metadata">

**Author:** ![vellingiri](https://www.ruby-forum.com/letter_avatar_proxy/v4/letter/v/5fc32e/32.png) [@vellingiri](https://www.ruby-forum.com/u/vellingiri)\
**Post date:** [November 28, 2007, 4:38pm UTC](https://www.ruby-forum.com/t/how-can-i-connect-with-postgresql-using-rails/121476/2 "2007-11-28T16:38:42Z")

</div>

install gem driver to connect your db : sudo gem install ruby-  
postgres.  
and configure your database.yml :

development:  
adapter: postgresql  
database: your\_development\_db\_name  
username: your\_user\_name  
password: your\_password  
host: host\_name  
encoding: unicode # to enable unicode encoding with PostGresql

(do it for test and production too)

that’s all!

On Nov 28, 10:34 am, Arul hari [removed\_email\_address@domain.invalid](mailto:removed_email_address@domain.invalid)
