# Postgres API problems

**URL:** <https://www.ruby-forum.com/t/postgres-api-problems/83791>\
**Category:** Ruby\
**Created:** [January 29, 2007, 7:22pm UTC](https://www.ruby-forum.com/t/postgres-api-problems/83791 "2007-01-29T19:22:03Z")\
**Posts on this page:** 2\
**Page:** 1

<div class="post-metadata">

**Author:** ![nicken](https://www.ruby-forum.com/letter_avatar_proxy/v4/letter/n/d07c76/32.png) [@nicken](https://www.ruby-forum.com/u/nicken)\
**Post date:** [January 29, 2007, 7:22pm UTC](https://www.ruby-forum.com/t/postgres-api-problems/83791/1 "2007-01-29T19:22:03Z")

</div>

I keep having similar problems with the ruby postgres API (the c api,  
not postgres-pr). I have now installed it on three different machines

- two running Ubuntu server 6.06 and most recently on Xubuntu Edgy.

I have libpq-dev and ruby1.8-dev installed. I only have one version  
of ruby 1.8 installed - from the Xubuntu repository.

gem install postgres

leads to a lot of terminal output, ending with:

Successfully installed postgres-0.7.1

But if I try:

# irb1.8

irb(main):001:0\> require ‘rubygems’  
=\> true  
irb(main):002:0\> require ‘postgres’  
LoadError: no such file to load – postgres  
from  
/usr/local/lib/site\_ruby/1.8/rubygems/custom\_require.rb:27:in  
`gem_original_require' from /usr/local/lib/site_ruby/1.8/rubygems/custom_require.rb:27:in`require’  
from (irb):2

I have also tried:

# POSTGRES\_INCLUDE=/usr/include/postgresql gem install postgres

I just can’t figure out what the difference is between the different  
boxes I’m trying to do this on.

Any help appreciated.

---

<div class="post-metadata">

**Author:** ![nicken](https://www.ruby-forum.com/letter_avatar_proxy/v4/letter/n/d07c76/32.png) [@nicken](https://www.ruby-forum.com/u/nicken)\
**Post date:** [January 29, 2007, 8:52pm UTC](https://www.ruby-forum.com/t/postgres-api-problems/83791/2 "2007-01-29T20:52:27Z")

</div>

On Tue, 2007-01-30 at 03:20 +0900, Nick B. wrote:

> I have libpq-dev and ruby1.8-dev installed. I only have one version  
> of ruby 1.8 installed - from the Xubuntu repository.
> 
> gem install postgres
> 
> leads to a lot of terminal output, ending with:
> 
> Successfully installed postgres-0.7.1

I bet it didn’t compile properly. Try going into the postgres gem build  
directory (on my computer  
it’s /usr/local/lib/ruby/gems/1.8/gems/postgres-0.7.1/) and run make  
and see if that fixes it.

Yours,

Tom
