# Rails3 + PostgreSQL

**URL:** <https://www.ruby-forum.com/t/rails3-postgresql/187497>\
**Category:** Rails\
**Created:** [April 24, 2010, 2:21am UTC](https://www.ruby-forum.com/t/rails3-postgresql/187497 "2010-04-24T02:21:04Z")\
**Posts on this page:** 5\
**Page:** 1

<div class="post-metadata">

**Author:** ![destiney](https://www.ruby-forum.com/letter_avatar_proxy/v4/letter/d/f07891/32.png) [@destiney](https://www.ruby-forum.com/u/destiney)\
**Post date:** [April 24, 2010, 2:21am UTC](https://www.ruby-forum.com/t/rails3-postgresql/187497/1 "2010-04-24T02:21:04Z")

</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:  
adapter: postgresql  
database: rails3\_dev  
username: rails3  
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?

–  
Greg D.  
[destiney.com](http://destiney.com) | [gregdonald.com](http://gregdonald.com)

---

<div class="post-metadata">

**Author:** ![destiney](https://www.ruby-forum.com/letter_avatar_proxy/v4/letter/d/f07891/32.png) [@destiney](https://www.ruby-forum.com/u/destiney)\
**Post date:** [April 25, 2010, 2:57am UTC](https://www.ruby-forum.com/t/rails3-postgresql/187497/2 "2010-04-25T02:57:40Z")

</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:** ![destiney](https://www.ruby-forum.com/letter_avatar_proxy/v4/letter/d/f07891/32.png) [@destiney](https://www.ruby-forum.com/u/destiney)\
**Post date:** [April 26, 2010, 5:38pm UTC](https://www.ruby-forum.com/t/rails3-postgresql/187497/3 "2010-04-26T17:38:58Z")

</div>

On Sat, Apr 24, 2010 at 7:56 PM, Ginty [removed\_email\_address@domain.invalid](mailto:removed_email_address@domain.invalid)  
wrote:

> Maybe the fact you have the others installed is part of the problem

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

–  
Greg D.  
[destiney.com](http://destiney.com) | [gregdonald.com](http://gregdonald.com)

---

<div class="post-metadata">

**Author:** ![destiney](https://www.ruby-forum.com/letter_avatar_proxy/v4/letter/d/f07891/32.png) [@destiney](https://www.ruby-forum.com/u/destiney)\
**Post date:** [April 26, 2010, 6:47pm UTC](https://www.ruby-forum.com/t/rails3-postgresql/187497/4 "2010-04-26T18:47:29Z")

</div>

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

2010/4/26 Greg D. [removed\_email\_address@domain.invalid](mailto:removed_email_address@domain.invalid)

> [destiney.com](http://destiney.com) | [gregdonald.com](http://gregdonald.com)

–  
Carina B. Silva

---

<div class="post-metadata">

**Author:** ![destiney](https://www.ruby-forum.com/letter_avatar_proxy/v4/letter/d/f07891/32.png) [@destiney](https://www.ruby-forum.com/u/destiney)\
**Post date:** [May 16, 2010, 12:50pm UTC](https://www.ruby-forum.com/t/rails3-postgresql/187497/5 "2010-05-16T12:50:24Z")

</div>

For me this helped to. Additionally I had to add “require ‘pg’” to the  
Gemfile. Thanks.
