# Rails3 + PostgreSQL

**URL:** <https://discuss.rubyonrails.org/t/rails3-postgresql/51153>\
**Category:** rubyonrails-talk\
**Created:** [April 24, 2010, 12:19am UTC](https://discuss.rubyonrails.org/t/rails3-postgresql/51153 "2010-04-24T00:19:16Z")\
**Posts on this page:** 5\
**Page:** 1

<div class="post-metadata">

**Author:** ![Greg\_Donald1](https://sea2.discourse-cdn.com/rubyonrails/user_avatar/discuss.rubyonrails.org/greg_donald1/32/1313_2.png) [@Greg\_Donald1](https://discuss.rubyonrails.org/u/Greg_Donald1)\
**Post date:** [April 24, 2010, 12:19am UTC](https://discuss.rubyonrails.org/t/rails3-postgresql/51153/1 "2010-04-24T00:19:16Z")

</div>

Anyone know if Rails 3 supports PostgreSQL yet? I'm again trying on the latest beta, still not getting anything to work.

I have every postgresql gem I can find installed:

> gem list --local|grep ^p

pg (0.9.0) postgres (0.7.9.2008.01.28) postgres-pr (0.6.3)

My database.yml entry:

development: &nbsp;&nbsp;adapter: postgresql &nbsp;&nbsp;database: rails3\_dev &nbsp;&nbsp;username: rails3 &nbsp;&nbsp;password: rails3

Then when I try it, I get this:

RuntimeError (Please install the postgresql adapter: `gem install activerecord-postgresql-adapter` (no such file to load -- pg)):

I'm not finding a gem by that name:

> gem install activerecord-postgresql-adapter

ERROR: could not find gem activerecord-postgresql-adapter locally or in a repository

This page doesn't even mention that gem:

[http://wiki.rubyonrails.org/database-support/postgres](http://wiki.rubyonrails.org/database-support/postgres)

Anyone get this to work yet?

---

<div class="post-metadata">

**Author:** ![Ginty1](https://avatars.discourse-cdn.com/v4/letter/g/e47c2d/32.png) [@Ginty1](https://discuss.rubyonrails.org/u/Ginty1)\
**Post date:** [April 25, 2010, 12:56am UTC](https://discuss.rubyonrails.org/t/rails3-postgresql/51153/2 "2010-04-25T00:56:11Z")

</div>

Yeah it works fine, worked since the first beta.

On Ubuntu these are the packages I installed:

sudo apt-get install postgresql postgresql-client postgresql-contrib libpq-dev

Then all you need is the pg gem mentioned in your Gemfile.

Maybe the fact you have the others installed is part of the problem, they are definitely not required for it to work, this is the only PostGres related gem I have in my Gemfile:

gem "pg"

---

<div class="post-metadata">

**Author:** ![Greg\_Donald1](https://sea2.discourse-cdn.com/rubyonrails/user_avatar/discuss.rubyonrails.org/greg_donald1/32/1313_2.png) [@Greg\_Donald1](https://discuss.rubyonrails.org/u/Greg_Donald1)\
**Post date:** [April 26, 2010, 3:25pm UTC](https://discuss.rubyonrails.org/t/rails3-postgresql/51153/3 "2010-04-26T15:25:46Z")

</div>

That was the problem. It works fine when pg is the only gem installed. Thanks.

---

<div class="post-metadata">

**Author:** ![Carina\_Brito](https://avatars.discourse-cdn.com/v4/letter/c/d9b06d/32.png) [@Carina\_Brito](https://discuss.rubyonrails.org/u/Carina_Brito)\
**Post date:** [April 26, 2010, 3:37pm UTC](https://discuss.rubyonrails.org/t/rails3-postgresql/51153/4 "2010-04-26T15:37:15Z")

</div>

Hi… i called Carina… i was either problem installed its gem…

---

<div class="post-metadata">

**Author:** ![Szymon\_Jez](https://avatars.discourse-cdn.com/v4/letter/s/2acd7d/32.png) [@Szymon\_Jez](https://discuss.rubyonrails.org/u/Szymon_Jez)\
**Post date:** [May 16, 2010, 10:48am UTC](https://discuss.rubyonrails.org/t/rails3-postgresql/51153/5 "2010-05-16T10:48:50Z")

</div>

For me this helped to. Additionally I had to add "require 'pg'" to the Gemfile. Thanks.
