# Error in migrating the Postgres database

**URL:** <https://www.ruby-forum.com/t/error-in-migrating-the-postgres-database/177820>\
**Category:** Rails\
**Created:** [October 24, 2009, 5:01pm UTC](https://www.ruby-forum.com/t/error-in-migrating-the-postgres-database/177820 "2009-10-24T17:01:34Z")\
**Posts on this page:** 5\
**Page:** 1

<div class="post-metadata">

**Author:** ![madhuri\_godade](https://www.ruby-forum.com/letter_avatar_proxy/v4/letter/m/e95f7d/32.png) [@madhuri\_godade](https://www.ruby-forum.com/u/madhuri_godade)\
**Post date:** [October 24, 2009, 5:01pm UTC](https://www.ruby-forum.com/t/error-in-migrating-the-postgres-database/177820/1 "2009-10-24T17:01:34Z")

</div>

I want to create a rails application using postgres database.  
Update a username and password terp and agile respectively.  
When i run the command rake db:create and rake db:migrate  
it is giving mi an error…

uninitialized constant  
ActiveRecord::ConnectionAdapters::PostgreSQLAdapter::PGconn

Please tell me how to resolve this error…

---

<div class="post-metadata">

**Author:** ![madhuri\_godade](https://www.ruby-forum.com/letter_avatar_proxy/v4/letter/m/e95f7d/32.png) [@madhuri\_godade](https://www.ruby-forum.com/u/madhuri_godade)\
**Post date:** [October 24, 2009, 5:09pm UTC](https://www.ruby-forum.com/t/error-in-migrating-the-postgres-database/177820/2 "2009-10-24T17:09:45Z")

</div>

Hope u have the postgre adapter installed.

---

<div class="post-metadata">

**Author:** ![madhuri\_godade](https://www.ruby-forum.com/letter_avatar_proxy/v4/letter/m/e95f7d/32.png) [@madhuri\_godade](https://www.ruby-forum.com/u/madhuri_godade)\
**Post date:** [October 29, 2009, 5:54am UTC](https://www.ruby-forum.com/t/error-in-migrating-the-postgres-database/177820/3 "2009-10-29T05:54:10Z")

</div>

Hello sir,

I have installed

gem to install is ruby-pg

gem to install is postgres

gem to install is postgres-pr

But still getting the same error…  
uninitialized constant  
ActiveRecord::ConnectionAdapters::PostgreSQLAdapter::PGconn

Is there any configuration needed for the postgreSQLAdapter…  
Please tell me how to resolve this error…

---

<div class="post-metadata">

**Author:** ![madhuri\_godade](https://www.ruby-forum.com/letter_avatar_proxy/v4/letter/m/e95f7d/32.png) [@madhuri\_godade](https://www.ruby-forum.com/u/madhuri_godade)\
**Post date:** [November 2, 2009, 10:20am UTC](https://www.ruby-forum.com/t/error-in-migrating-the-postgres-database/177820/4 "2009-11-02T10:20:00Z")

</div>

put in config/environment.rb this string:

config.gem “postgres”

or another gem which you use

---

<div class="post-metadata">

**Author:** ![madhuri\_godade](https://www.ruby-forum.com/letter_avatar_proxy/v4/letter/m/e95f7d/32.png) [@madhuri\_godade](https://www.ruby-forum.com/u/madhuri_godade)\
**Post date:** [December 17, 2009, 12:50pm UTC](https://www.ruby-forum.com/t/error-in-migrating-the-postgres-database/177820/5 "2009-12-17T12:50:54Z")

</div>

On Ubuntu 9.10 I solved same error by installing libpgsql-ruby:  
sudo aptitude install libpgsql-ruby
