# Connect to postgres db

**URL:** <https://www.ruby-forum.com/t/connect-to-postgres-db/65530>\
**Category:** Rails\
**Created:** [August 18, 2006, 9:51pm UTC](https://www.ruby-forum.com/t/connect-to-postgres-db/65530 "2006-08-18T21:51:09Z")\
**Posts on this page:** 4\
**Page:** 1

<div class="post-metadata">

**Author:** ![TTTTTT](https://www.ruby-forum.com/letter_avatar_proxy/v4/letter/t/8797f3/32.png) [@TTTTTT](https://www.ruby-forum.com/u/TTTTTT)\
**Post date:** [August 18, 2006, 9:51pm UTC](https://www.ruby-forum.com/t/connect-to-postgres-db/65530/1 "2006-08-18T21:51:09Z")

</div>

I’ve followed the tutorial and just don’t get it.

How do I connect my ruby/rails sample app to my postgres database.

I did follow step 1-4 of the tutorial, I go to step 5:  
([http://wiki.rubyonrails.org/rails/pages/TutorialStepFive](http://wiki.rubyonrails.org/rails/pages/TutorialStepFive))

and try the “rake” commmand and get this:  
rake aborted!  
no such file to load – postgres

so I ran with -trace and get this:

## F:\rubySampleApp\>rake -trace

f:/ruby/lib/ruby/site\_ruby/1.8/rubygems/custom\_require.rb:27:in  
`gem_original_re quire': no such file to load -- ace (LoadError) from f:/ruby/lib/ruby/site_ruby/1.8/rubygems/custom_require.rb:27:in `re  
quire’  
from  
f:/ruby/lib/ruby/gems/1.8/gems/rake-0.7.1/lib/rake.rb:1749:in `do_o ption' from f:/ruby/lib/ruby/gems/1.8/gems/rake-0.7.1/lib/rake.rb:1787:in `hand  
le\_options’  
from f:/ruby/lib/ruby/1.8/getoptlong.rb:460:in `each' from f:/ruby/lib/ruby/1.8/getoptlong.rb:457:in `each’  
from  
f:/ruby/lib/ruby/gems/1.8/gems/rake-0.7.1/lib/rake.rb:1787:in `hand le_options' from f:/ruby/lib/ruby/gems/1.8/gems/rake-0.7.1/lib/rake.rb:1897:in `run’

```
    from f:/ruby/lib/ruby/gems/1.8/gems/rake-0.7.1/bin/rake:7
    from f:/ruby/bin/rake.bat:25

```

* * *

now, my database.yml file contains this:

development:  
adapter: postgresql  
database: mace  
username: postgres  
password: postgres  
host: localhost

I am running on Windows XP and have Postgres 8.0.3 running.

Thank you in advance for your ideas !

T

---

<div class="post-metadata">

**Author:** ![TTTTTT](https://www.ruby-forum.com/letter_avatar_proxy/v4/letter/t/8797f3/32.png) [@TTTTTT](https://www.ruby-forum.com/u/TTTTTT)\
**Post date:** [August 18, 2006, 10:03pm UTC](https://www.ruby-forum.com/t/connect-to-postgres-db/65530/2 "2006-08-18T22:03:15Z")

</div>

My guess would be that you need to install the postgres gem.

Joe

---

<div class="post-metadata">

**Author:** ![TTTTTT](https://www.ruby-forum.com/letter_avatar_proxy/v4/letter/t/8797f3/32.png) [@TTTTTT](https://www.ruby-forum.com/u/TTTTTT)\
**Post date:** [August 18, 2006, 10:12pm UTC](https://www.ruby-forum.com/t/connect-to-postgres-db/65530/3 "2006-08-18T22:12:24Z")

</div>

Have you installed the Postgres gem (gem install postgres)? Don’t  
install  
postgres-pr, the pure ruby wrapper, as it does not work at all last I  
tried.  
The postgres gem does require compilation, so make sure you have the  
postgres devel headers and a proper compiler.

Jason

---

<div class="post-metadata">

**Author:** ![TTTTTT](https://www.ruby-forum.com/letter_avatar_proxy/v4/letter/t/8797f3/32.png) [@TTTTTT](https://www.ruby-forum.com/u/TTTTTT)\
**Post date:** [August 18, 2006, 10:17pm UTC](https://www.ruby-forum.com/t/connect-to-postgres-db/65530/4 "2006-08-18T22:17:10Z")

</div>

Joe R. wrote:

> My guess would be that you need to install the postgres gem.
> 
> Joe

ok. I tried this:

gem install postgress (from my sample app directory)  
and I get this error:

F:\rubySampleApp\>gem install postgres  
ERROR: While executing gem … (URI::InvalidURIError)  
bad URI(is not URI?): “xxproxy:8080”

Note, that I am behind a firewall and I have set this environment  
variable:  
set http\_proxy=“xxproxy:8080”
