# Rake aborts with "no such file to load -- postgres"

**URL:** <https://www.ruby-forum.com/t/rake-aborts-with-no-such-file-to-load-postgres/72468>\
**Category:** Rails\
**Created:** [October 17, 2006, 1:03pm UTC](https://www.ruby-forum.com/t/rake-aborts-with-no-such-file-to-load-postgres/72468 "2006-10-17T13:03:20Z")\
**Posts on this page:** 3\
**Page:** 1

<div class="post-metadata">

**Author:** ![cronjob](https://www.ruby-forum.com/letter_avatar_proxy/v4/letter/c/aeb1de/32.png) [@cronjob](https://www.ruby-forum.com/u/cronjob)\
**Post date:** [October 17, 2006, 1:03pm UTC](https://www.ruby-forum.com/t/rake-aborts-with-no-such-file-to-load-postgres/72468/1 "2006-10-17T13:03:20Z")

</div>

Kubuntu Dapper(6.06)  
Ruby 1.8.4  
Rails 1.1.6

I’ve tried installing the rubygems deb from the sgtpepper sources.list  
as well as building rubygems from source, but I get the same problem.  
I’m stuck on how to continue from this point and am looking for some  
guidance.

- I install rubygems 0.9.0 from source.

- I run “gem install rails --include-dependencies”

- I run “gem install postgres”.

- I run “gem list” to verify that it can find postgres:

- I run “rails depot”.

- I modify …/depot/config/database.yml by adding username and  
‘postgresql’.

- I test that I can connect manually via psql.

- I run “rake --trace db:migrate” to test that I can connect, but get  
the following:

blackadder:~/www/depot$ rake --trace db:migrate

(in /www/depot)  
\*\* Invoke db:migrate (first\_time)  
\*\* Invoke environment (first\_time)  
\*\* Execute environment  
\*\* Execute db:migrate  
rake aborted!  
no such file to load – postgres  
/usr/local/lib/site\_ruby/1.8/rubygems/custom\_require.rb:27:in  
`gem_original_require' /usr/local/lib/site_ruby/1.8/rubygems/custom_require.rb:27:in`require’  
/usr/lib/ruby/gems/1.8/gems/activesupport-1.3.1/lib/active\_support/dependencies.rb:147:in  
`require' /usr/lib/ruby/gems/1.8/gems/activesupport-1.3.1/lib/active_support/core_ext/kernel/requires.rb:7:in`require\_library\_or\_gem’  
/usr/lib/ruby/gems/1.8/gems/activesupport-1.3.1/lib/active\_support/core\_ext/kernel/reporting.rb:11:in  
`silence_warnings' /usr/lib/ruby/gems/1.8/gems/activesupport-1.3.1/lib/active_support/core_ext/kernel/requires.rb:5:in`require\_library\_or\_gem’  
/usr/lib/ruby/gems/1.8/gems/activerecord-1.14.4/lib/active\_record/connection\_adapters/postgresql\_adapter.rb:7:in  
`postgresql_connection' /usr/lib/ruby/gems/1.8/gems/activerecord-1.14.4/lib/active_record/connection_adapters/abstract/connection_specification.rb:251:in`connection\_without\_query\_cache=’  
/usr/lib/ruby/gems/1.8/gems/activerecord-1.14.4/lib/active\_record/query\_cache.rb:54:in  
`connection=' /usr/lib/ruby/gems/1.8/gems/activerecord-1.14.4/lib/active_record/connection_adapters/abstract/connection_specification.rb:220:in`retrieve\_connection’  
/usr/lib/ruby/gems/1.8/gems/activerecord-1.14.4/lib/active\_record/connection\_adapters/abstract/connection\_specification.rb:78:in  
`connection' /usr/lib/ruby/gems/1.8/gems/activerecord-1.14.4/lib/active_record/migration.rb:282:in`migrate’  
/usr/lib/ruby/gems/1.8/gems/rails-1.1.6/lib/tasks/databases.rake:4  
/usr/lib/ruby/gems/1.8/gems/rake-0.7.1/lib/rake.rb:387:in `execute' /usr/lib/ruby/gems/1.8/gems/rake-0.7.1/lib/rake.rb:387:in`execute’  
/usr/lib/ruby/gems/1.8/gems/rake-0.7.1/lib/rake.rb:357:in `invoke' /usr/lib/ruby/1.8/thread.rb:135:in`synchronize’  
/usr/lib/ruby/gems/1.8/gems/rake-0.7.1/lib/rake.rb:350:in `invoke' /usr/lib/ruby/gems/1.8/gems/rake-0.7.1/lib/rake.rb:1906:in`run’  
/usr/lib/ruby/gems/1.8/gems/rake-0.7.1/lib/rake.rb:1906:in `run’  
/usr/lib/ruby/gems/1.8/gems/rake-0.7.1/bin/rake:7  
/usr/bin/rake:18

---

<div class="post-metadata">

**Author:** ![cronjob](https://www.ruby-forum.com/letter_avatar_proxy/v4/letter/c/aeb1de/32.png) [@cronjob](https://www.ruby-forum.com/u/cronjob)\
**Post date:** [October 18, 2006, 10:46am UTC](https://www.ruby-forum.com/t/rake-aborts-with-no-such-file-to-load-postgres/72468/2 "2006-10-18T10:46:16Z")

</div>

enable the universe repositories, then do this:

# gem uninstall postgres

# apt-get update

# apt-get install libpgsql-ruby

the postgres gem doesn’t seem to link against libpq correctly on  
debian / ubuntu.

---

<div class="post-metadata">

**Author:** ![cronjob](https://www.ruby-forum.com/letter_avatar_proxy/v4/letter/c/aeb1de/32.png) [@cronjob](https://www.ruby-forum.com/u/cronjob)\
**Post date:** [October 18, 2006, 12:46am UTC](https://www.ruby-forum.com/t/rake-aborts-with-no-such-file-to-load-postgres/72468/3 "2006-10-18T00:46:51Z")

</div>

Can someone at least confirm what the message “no such file to load –  
postgres” means? Does that mean a specific file can’t be found? Does  
this mean some postgresql binary can’t be found? Does this mean that the  
postgres gem itself can’t be found, even though “gem list” shows it is  
there?

This is the output of the “gem install postgres” – the make is  
successful, but should there be all of these warnings and errors? Also,  
I have postgresql-server-dev-8.1 installed.

The rake aborted error doesn’t really tell me much, so I don’t know if  
the problem is with my rails install, my rubygems install, my postgresql  
source code, my ruby install itself or just the postgres gem. I also  
encountered the same problem with “gem install ruby-postgres”.

blackadder:~/www/depot$ sudo gem install postgres –  
–include-dir=/usr/include/postgresql  
Building native extensions. This could take a while…  
postgres.c:18:22: error: libpq-fe.h: No such file or directory  
postgres.c:19:70: error: libpq/libpq-fs.h: No such file or directory  
postgres.c:35: error: syntax error before â??\*â?? token  
postgres.c:44: error: syntax error before â??PGconnâ??  
postgres.c:44: warning: no semicolon at end of struct or union  
postgres.c:45: warning: data definition has no type or storage class  
postgres.c:47: error: syntax error before â??}â?? token  
postgres.c:47: warning: data definition has no type or storage class  
postgres.c:49: error: syntax error before â??\*â?? token  
postgres.c:54: error: syntax error before â??PGconnâ??  
postgres.c:54: warning: data definition has no type or storage class  
postgres.c:55: error: syntax error before â??{â?? token  
postgres.c: In function â??pgconn\_s\_connectâ??:  
postgres.c:69: error: â??PGconnâ?? undeclared (first use in this function)  
postgres.c:69: error: (Each undeclared identifier is reported only once  
postgres.c:69: error: for each function it appears in.)  
postgres.c:69: error: â??connâ?? undeclared (first use in this function)  
postgres.c:112: error: â??CONNECTION\_BADâ?? undeclared (first use in this  
function)  
postgres.c:113: warning: passing argument 2 of â??rb\_raiseâ?? makes pointer  
from integer without a cast  
postgres.c:116: error: â??free\_pgconnâ?? undeclared (first use in this  
function)  
postgres.c: In function â??pgconn\_s\_escape\_byteaâ??:  
postgres.c:222: warning: cast to pointer from integer of different size  
postgres.c: At top level:  
postgres.c:254: error: syntax error before â??\*â?? token  
postgres.c: In function â??get\_pgconnâ??:  
postgres.c:258: error: â??PGconnâ?? undeclared (first use in this function)  
postgres.c:258: error: â??connâ?? undeclared (first use in this function)  
postgres.c:260: error: syntax error before â??)â?? token  
postgres.c: At top level:  
postgres.c:283: error: syntax error before â??\*â?? token  
postgres.c: In function â??get\_pgresultâ??:  
postgres.c:287: error: â??PGresultâ?? undeclared (first use in this  
function)  
postgres.c:287: error: â??resultâ?? undeclared (first use in this function)  
postgres.c:289: error: syntax error before â??)â?? token  
postgres.c: In function â??pgconn\_execâ??:  
postgres.c:298: error: â??PGconnâ?? undeclared (first use in this function)  
postgres.c:298: error: â??connâ?? undeclared (first use in this function)  
postgres.c:299: error: â??PGresultâ?? undeclared (first use in this  
function)  
postgres.c:299: error: â??resultâ?? undeclared (first use in this function)  
postgres.c:307: warning: passing argument 2 of â??rb\_raiseâ?? makes pointer  
from integer without a cast  
postgres.c:312: error: â??PGRES\_TUPLES\_OKâ?? undeclared (first use in this  
function)  
postgres.c:313: error: â??PGRES\_COPY\_OUTâ?? undeclared (first use in this  
function)  
postgres.c:314: error: â??PGRES\_COPY\_INâ?? undeclared (first use in this  
function)  
postgres.c:315: error: â??PGRES\_EMPTY\_QUERYâ?? undeclared (first use in this  
function)  
postgres.c:316: error: â??PGRES\_COMMAND\_OKâ?? undeclared (first use in this  
function)  
postgres.c:319: error: â??PGRES\_BAD\_RESPONSEâ?? undeclared (first use in  
this function)  
postgres.c:320: error: â??PGRES\_FATAL\_ERRORâ?? undeclared (first use in this  
function)  
postgres.c:321: error: â??PGRES\_NONFATAL\_ERRORâ?? undeclared (first use in  
this function)  
postgres.c:322: warning: assignment makes pointer from integer without a  
cast  
postgres.c: In function â??pgconn\_async\_execâ??:  
postgres.c:336: error: â??PGconnâ?? undeclared (first use in this function)  
postgres.c:336: error: â??connâ?? undeclared (first use in this function)  
postgres.c:337: error: â??PGresultâ?? undeclared (first use in this  
function)  
postgres.c:337: error: â??resultâ?? undeclared (first use in this function)  
postgres.c:352: warning: passing argument 2 of â??rb\_raiseâ?? makes pointer  
from integer without a cast  
postgres.c:369: warning: passing argument 2 of â??rb\_raiseâ?? makes pointer  
from integer without a cast  
postgres.c:380: warning: passing argument 2 of â??rb\_raiseâ?? makes pointer  
from integer without a cast  
postgres.c:385: error: â??PGRES\_TUPLES\_OKâ?? undeclared (first use in this  
function)  
postgres.c:386: error: â??PGRES\_COPY\_OUTâ?? undeclared (first use in this  
function)  
postgres.c:387: error: â??PGRES\_COPY\_INâ?? undeclared (first use in this  
function)  
postgres.c:388: error: â??PGRES\_EMPTY\_QUERYâ?? undeclared (first use in this  
function)  
postgres.c:389: error: â??PGRES\_COMMAND\_OKâ?? undeclared (first use in this  
function)  
postgres.c:392: error: â??PGRES\_BAD\_RESPONSEâ?? undeclared (first use in  
this function)  
postgres.c:393: error: â??PGRES\_FATAL\_ERRORâ?? undeclared (first use in this  
function)  
postgres.c:394: error: â??PGRES\_NONFATAL\_ERRORâ?? undeclared (first use in  
this function)  
postgres.c:395: warning: assignment makes pointer from integer without a  
cast  
postgres.c: In function â??pgconn\_get\_notifyâ??:  
postgres.c:425: error: â??PGnotifyâ?? undeclared (first use in this  
function)  
postgres.c:425: error: â??notifyâ?? undeclared (first use in this function)  
postgres.c: In function â??pgconn\_insert\_tableâ??:  
postgres.c:450: error: â??PGconnâ?? undeclared (first use in this function)  
postgres.c:450: error: â??connâ?? undeclared (first use in this function)  
postgres.c:451: error: â??PGresultâ?? undeclared (first use in this  
function)  
postgres.c:451: error: â??resultâ?? undeclared (first use in this function)  
postgres.c:471: warning: passing argument 2 of â??rb\_raiseâ?? makes pointer  
from integer without a cast  
postgres.c: In function â??pgconn\_getlineâ??:  
postgres.c:511: error: â??PGconnâ?? undeclared (first use in this function)  
postgres.c:511: error: â??connâ?? undeclared (first use in this function)  
postgres.c: In function â??pgconn\_notifiesâ??:  
postgres.c:550: error: â??PGnotifyâ?? undeclared (first use in this  
function)  
postgres.c:550: error: â??notifiesâ?? undeclared (first use in this  
function)  
postgres.c: In function â??pgconn\_hostâ??:  
postgres.c:558: warning: initialization makes pointer from integer  
without a cast  
postgres.c: In function â??pgconn\_portâ??:  
postgres.c:567: warning: initialization makes pointer from integer  
without a cast  
postgres.c: In function â??pgconn\_dbâ??:  
postgres.c:575: warning: initialization makes pointer from integer  
without a cast  
postgres.c: In function â??pgconn\_optionsâ??:  
postgres.c:584: warning: initialization makes pointer from integer  
without a cast  
postgres.c: In function â??pgconn\_ttyâ??:  
postgres.c:593: warning: initialization makes pointer from integer  
without a cast  
postgres.c: In function â??pgconn\_userâ??:  
postgres.c:602: warning: initialization makes pointer from integer  
without a cast  
postgres.c: In function â??pgconn\_errorâ??:  
postgres.c:619: warning: initialization makes pointer from integer  
without a cast  
postgres.c: In function â??pgconn\_client\_encodingâ??:  
postgres.c:651: warning: cast to pointer from integer of different size  
postgres.c: At top level:  
postgres.c:669: error: syntax error before â??PGresultâ??  
postgres.c:669: warning: data definition has no type or storage class  
postgres.c:670: error: syntax error before â??{â?? token  
postgres.c:676: error: syntax error before â??PGresultâ??  
postgres.c:676: warning: data definition has no type or storage class  
postgres.c:679: error: syntax error before â??{â?? token  
postgres.c:683: error: â??valuestrâ?? undeclared here (not in a function)  
postgres.c:683: error: initializer element is not constant  
postgres.c:683: warning: data definition has no type or storage class  
postgres.c:684: error: syntax error before â??}â?? token  
postgres.c:693: error: syntax error before â??PGresultâ??  
postgres.c:693: warning: data definition has no type or storage class  
postgres.c:694: error: syntax error before â??{â?? token  
postgres.c: In function â??pgresult\_resultâ??:  
postgres.c:712: error: â??PGresultâ?? undeclared (first use in this  
function)  
postgres.c: In function â??pgresult\_eachâ??:  
postgres.c:736: error: â??PGresultâ?? undeclared (first use in this  
function)  
postgres.c: In function â??pgresult\_arefâ??:  
postgres.c:760: error: â??PGresultâ?? undeclared (first use in this  
function)  
postgres.c: In function â??pgresult\_fieldsâ??:  
postgres.c:795: error: â??PGresultâ?? undeclared (first use in this  
function)  
postgres.c:803: warning: passing argument 1 of â??rb\_tainted\_str\_new2â??  
makes pointer from integer without a cast  
postgres.c: In function â??pgresult\_fieldnameâ??:  
postgres.c:832: error: â??PGresultâ?? undeclared (first use in this  
function)  
postgres.c:840: warning: assignment makes pointer from integer without a  
cast  
postgres.c: In function â??pgresult\_typeâ??:  
postgres.c:863: error: â??PGresultâ?? undeclared (first use in this  
function)  
postgres.c: In function â??pgresult\_sizeâ??:  
postgres.c:879: error: â??PGresultâ?? undeclared (first use in this  
function)  
postgres.c: In function â??pgresult\_getvalueâ??:  
postgres.c:895: error: â??PGresultâ?? undeclared (first use in this  
function)  
postgres.c: In function â??pgresult\_getlengthâ??:  
postgres.c:914: error: â??PGresultâ?? undeclared (first use in this  
function)  
postgres.c: In function â??pgresult\_getisnullâ??:  
postgres.c:932: error: â??PGresultâ?? undeclared (first use in this  
function)  
postgres.c: In function â??pgresult\_printâ??:  
postgres.c:953: error: â??PQprintOptâ?? undeclared (first use in this  
function)  
postgres.c:953: error: syntax error before â??poâ??  
postgres.c:959: error: â??poâ?? undeclared (first use in this function)  
postgres.c: In function â??pgresult\_cmdtuplesâ??:  
postgres.c:1015: warning: passing argument 1 of â??strtolâ?? makes pointer  
from integer without a cast  
postgres.c: In function â??pgresult\_cmdstatusâ??:  
postgres.c:1023: warning: passing argument 1 of â??rb\_tainted\_str\_new2â??  
makes pointer from integer without a cast  
postgres.c: At top level:  
postgres.c:1046: error: syntax error before â??\*â?? token  
postgres.c: In function â??get\_pglargeâ??:  
postgres.c:1050: error: â??pglargeâ?? undeclared (first use in this  
function)  
postgres.c:1051: error: syntax error before â??)â?? token  
postgres.c: In function â??pgconn\_loimportâ??:  
postgres.c:1060: error: â??Oidâ?? undeclared (first use in this function)  
postgres.c:1060: error: syntax error before â??lo\_oidâ??  
postgres.c:1062: error: â??PGconnâ?? undeclared (first use in this function)  
postgres.c:1062: error: â??connâ?? undeclared (first use in this function)  
postgres.c:1068: warning: passing argument 2 of â??rb\_raiseâ?? makes pointer  
from integer without a cast  
postgres.c: In function â??pgconn\_loexportâ??:  
postgres.c:1077: error: â??PGconnâ?? undeclared (first use in this function)  
postgres.c:1077: error: â??connâ?? undeclared (first use in this function)  
postgres.c:1087: warning: passing argument 2 of â??rb\_raiseâ?? makes pointer  
from integer without a cast  
postgres.c: In function â??pgconn\_locreateâ??:  
postgres.c:1098: error: â??Oidâ?? undeclared (first use in this function)  
postgres.c:1098: error: syntax error before â??lo\_oidâ??  
postgres.c:1101: error: â??PGconnâ?? undeclared (first use in this function)  
postgres.c:1101: error: â??connâ?? undeclared (first use in this function)  
postgres.c:1104: error: â??INV\_READâ?? undeclared (first use in this  
function)  
postgres.c: In function â??pgconn\_loopenâ??:  
postgres.c:1125: error: â??Oidâ?? undeclared (first use in this function)  
postgres.c:1125: error: syntax error before â??lo\_oidâ??  
postgres.c:1128: error: â??PGconnâ?? undeclared (first use in this function)  
postgres.c:1128: error: â??connâ?? undeclared (first use in this function)  
postgres.c:1133: error: â??INV\_READâ?? undeclared (first use in this  
function)  
postgres.c: In function â??pgconn\_lounlinkâ??:  
postgres.c:1156: error: â??PGconnâ?? undeclared (first use in this function)  
postgres.c:1156: error: â??connâ?? undeclared (first use in this function)  
postgres.c: At top level:  
postgres.c:1171: error: syntax error before â??PGlargeâ??  
postgres.c:1171: warning: data definition has no type or storage class  
postgres.c:1172: error: syntax error before â??{â?? token  
postgres.c:1176: warning: parameter names (without types) in function  
declaration  
postgres.c:1176: error: conflicting types for â??freeâ??  
/usr/include/stdlib.h:597: error: previous declaration of â??freeâ?? was  
here  
postgres.c:1176: warning: data definition has no type or storage class  
postgres.c:1177: error: syntax error before â??}â?? token  
postgres.c:1181: error: syntax error before â??PGconnâ??  
postgres.c:1181: warning: data definition has no type or storage class  
postgres.c:1182: error: syntax error before â??lo\_oidâ??  
postgres.c:1182: warning: data definition has no type or storage class  
postgres.c:1184: error: syntax error before â??{â?? token  
postgres.c:1186: warning: data definition has no type or storage class  
postgres.c:1188: error: syntax error before â??)â?? token  
postgres.c: In function â??pglarge\_oidâ??:  
postgres.c:1200: error: invalid operands to binary \*  
postgres.c:1202: error: request for member â??lo\_oidâ?? in something not a  
structure or union  
postgres.c: In function â??pglarge\_openâ??:  
postgres.c:1211: error: invalid operands to binary \*  
postgres.c:1217: error: â??INV\_READâ?? undeclared (first use in this  
function)  
postgres.c:1223: error: request for member â??pgconnâ?? in something not a  
structure or union  
postgres.c:1223: error: request for member â??lo\_oidâ?? in something not a  
structure or union  
postgres.c:1226: error: request for member â??lo\_fdâ?? in something not a  
structure or union  
postgres.c:1228: error: request for member â??lo\_fdâ?? in something not a  
structure or union  
postgres.c: In function â??pglarge\_closeâ??:  
postgres.c:1235: error: invalid operands to binary \*  
postgres.c:1237: error: request for member â??pgconnâ?? in something not a  
structure or union  
postgres.c:1237: error: request for member â??lo\_fdâ?? in something not a  
structure or union  
postgres.c: In function â??pglarge\_tellâ??:  
postgres.c:1250: error: invalid operands to binary \*  
postgres.c:1252: error: request for member â??pgconnâ?? in something not a  
structure or union  
postgres.c:1252: error: request for member â??lo\_fdâ?? in something not a  
structure or union  
postgres.c: In function â??loread\_allâ??:  
postgres.c:1262: error: invalid operands to binary \*  
postgres.c:1270: error: request for member â??pgconnâ?? in something not a  
structure or union  
postgres.c:1270: error: request for member â??lo\_fdâ?? in something not a  
structure or union  
postgres.c: In function â??pglarge\_readâ??:  
postgres.c:1289: error: invalid operands to binary \*  
postgres.c:1304: error: request for member â??pgconnâ?? in something not a  
structure or union  
postgres.c:1304: error: request for member â??lo\_fdâ?? in something not a  
structure or union  
postgres.c: In function â??pglarge\_writeâ??:  
postgres.c:1317: error: invalid operands to binary \*  
postgres.c:1324: error: request for member â??pgconnâ?? in something not a  
structure or union  
postgres.c:1324: error: request for member â??lo\_fdâ?? in something not a  
structure or union  
postgres.c: In function â??pglarge\_seekâ??:  
postgres.c:1335: error: invalid operands to binary \*  
postgres.c:1338: error: request for member â??pgconnâ?? in something not a  
structure or union  
postgres.c:1338: error: request for member â??lo\_fdâ?? in something not a  
structure or union  
postgres.c: In function â??pglarge\_sizeâ??:  
postgres.c:1349: error: invalid operands to binary \*  
postgres.c:1352: error: request for member â??pgconnâ?? in something not a  
structure or union  
postgres.c:1352: error: request for member â??lo\_fdâ?? in something not a  
structure or union  
postgres.c:1356: error: request for member â??pgconnâ?? in something not a  
structure or union  
postgres.c:1356: error: request for member â??lo\_fdâ?? in something not a  
structure or union  
postgres.c:1360: error: request for member â??pgconnâ?? in something not a  
structure or union  
postgres.c:1360: error: request for member â??lo\_fdâ?? in something not a  
structure or union  
postgres.c: In function â??pglarge\_exportâ??:  
postgres.c:1371: error: invalid operands to binary \*  
postgres.c:1375: error: request for member â??pgconnâ?? in something not a  
structure or union  
postgres.c:1375: error: request for member â??lo\_oidâ?? in something not a  
structure or union  
postgres.c:1376: error: request for member â??pgconnâ?? in something not a  
structure or union  
postgres.c:1376: warning: passing argument 2 of â??rb\_raiseâ?? makes pointer  
from integer without a cast  
postgres.c: In function â??pglarge\_unlinkâ??:  
postgres.c:1386: error: invalid operands to binary \*  
postgres.c:1388: error: request for member â??pgconnâ?? in something not a  
structure or union  
postgres.c:1388: error: request for member â??lo\_oidâ?? in something not a  
structure or union  
postgres.c:1389: error: request for member â??pgconnâ?? in something not a  
structure or union  
postgres.c:1389: warning: passing argument 2 of â??rb\_raiseâ?? makes pointer  
from integer without a cast  
postgres.c: In function â??Init\_postgresâ??:  
postgres.c:1418: error: â??CONNECTION\_OKâ?? undeclared (first use in this  
function)  
postgres.c:1419: error: â??CONNECTION\_BADâ?? undeclared (first use in this  
function)  
postgres.c:1476: error: â??INV\_WRITEâ?? undeclared (first use in this  
function)  
postgres.c:1477: error: â??INV\_READâ?? undeclared (first use in this  
function)  
postgres.c:1486: error: â??PGRES\_EMPTY\_QUERYâ?? undeclared (first use in  
this function)  
postgres.c:1487: error: â??PGRES\_COMMAND\_OKâ?? undeclared (first use in this  
function)  
postgres.c:1488: error: â??PGRES\_TUPLES\_OKâ?? undeclared (first use in this  
function)  
postgres.c:1489: error: â??PGRES\_COPY\_OUTâ?? undeclared (first use in this  
function)  
postgres.c:1490: error: â??PGRES\_COPY\_INâ?? undeclared (first use in this  
function)  
postgres.c:1491: error: â??PGRES\_BAD\_RESPONSEâ?? undeclared (first use in  
this function)  
postgres.c:1492: error: â??PGRES\_NONFATAL\_ERRORâ?? undeclared (first use in  
this function)  
postgres.c:1493: error: â??PGRES\_FATAL\_ERRORâ?? undeclared (first use in  
this function)  
make: \*\*\* [postgres.o] Error 1  
postgres.c:18:22: error: libpq-fe.h: No such file or directory  
postgres.c:19:70: error: libpq/libpq-fs.h: No such file or directory  
postgres.c:35: error: syntax error before â??\*â?? token  
postgres.c:44: error: syntax error before â??PGconnâ??  
postgres.c:44: warning: no semicolon at end of struct or union  
postgres.c:45: warning: data definition has no type or storage class  
postgres.c:47: error: syntax error before â??}â?? token  
postgres.c:47: warning: data definition has no type or storage class  
postgres.c:49: error: syntax error before â??\*â?? token  
postgres.c:54: error: syntax error before â??PGconnâ??  
postgres.c:54: warning: data definition has no type or storage class  
postgres.c:55: error: syntax error before â??{â?? token  
postgres.c: In function â??pgconn\_s\_connectâ??:  
postgres.c:69: error: â??PGconnâ?? undeclared (first use in this function)  
postgres.c:69: error: (Each undeclared identifier is reported only once  
postgres.c:69: error: for each function it appears in.)  
postgres.c:69: error: â??connâ?? undeclared (first use in this function)  
postgres.c:112: error: â??CONNECTION\_BADâ?? undeclared (first use in this  
function)  
postgres.c:113: warning: passing argument 2 of â??rb\_raiseâ?? makes pointer  
from integer without a cast  
postgres.c:116: error: â??free\_pgconnâ?? undeclared (first use in this  
function)  
postgres.c: In function â??pgconn\_s\_escape\_byteaâ??:  
postgres.c:222: warning: cast to pointer from integer of different size  
postgres.c: At top level:  
postgres.c:254: error: syntax error before â??\*â?? token  
postgres.c: In function â??get\_pgconnâ??:  
postgres.c:258: error: â??PGconnâ?? undeclared (first use in this function)  
postgres.c:258: error: â??connâ?? undeclared (first use in this function)  
postgres.c:260: error: syntax error before â??)â?? token  
postgres.c: At top level:  
postgres.c:283: error: syntax error before â??\*â?? token  
postgres.c: In function â??get\_pgresultâ??:  
postgres.c:287: error: â??PGresultâ?? undeclared (first use in this  
function)  
postgres.c:287: error: â??resultâ?? undeclared (first use in this function)  
postgres.c:289: error: syntax error before â??)â?? token  
postgres.c: In function â??pgconn\_execâ??:  
postgres.c:298: error: â??PGconnâ?? undeclared (first use in this function)  
postgres.c:298: error: â??connâ?? undeclared (first use in this function)  
postgres.c:299: error: â??PGresultâ?? undeclared (first use in this  
function)  
postgres.c:299: error: â??resultâ?? undeclared (first use in this function)  
postgres.c:307: warning: passing argument 2 of â??rb\_raiseâ?? makes pointer  
from integer without a cast  
postgres.c:312: error: â??PGRES\_TUPLES\_OKâ?? undeclared (first use in this  
function)  
postgres.c:313: error: â??PGRES\_COPY\_OUTâ?? undeclared (first use in this  
function)  
postgres.c:314: error: â??PGRES\_COPY\_INâ?? undeclared (first use in this  
function)  
postgres.c:315: error: â??PGRES\_EMPTY\_QUERYâ?? undeclared (first use in this  
function)  
postgres.c:316: error: â??PGRES\_COMMAND\_OKâ?? undeclared (first use in this  
function)  
postgres.c:319: error: â??PGRES\_BAD\_RESPONSEâ?? undeclared (first use in  
this function)  
postgres.c:320: error: â??PGRES\_FATAL\_ERRORâ?? undeclared (first use in this  
function)  
postgres.c:321: error: â??PGRES\_NONFATAL\_ERRORâ?? undeclared (first use in  
this function)  
postgres.c:322: warning: assignment makes pointer from integer without a  
cast  
postgres.c: In function â??pgconn\_async\_execâ??:  
postgres.c:336: error: â??PGconnâ?? undeclared (first use in this function)  
postgres.c:336: error: â??connâ?? undeclared (first use in this function)  
postgres.c:337: error: â??PGresultâ?? undeclared (first use in this  
function)  
postgres.c:337: error: â??resultâ?? undeclared (first use in this function)  
postgres.c:352: warning: passing argument 2 of â??rb\_raiseâ?? makes pointer  
from integer without a cast  
postgres.c:369: warning: passing argument 2 of â??rb\_raiseâ?? makes pointer  
from integer without a cast  
postgres.c:380: warning: passing argument 2 of â??rb\_raiseâ?? makes pointer  
from integer without a cast  
postgres.c:385: error: â??PGRES\_TUPLES\_OKâ?? undeclared (first use in this  
function)  
postgres.c:386: error: â??PGRES\_COPY\_OUTâ?? undeclared (first use in this  
function)  
postgres.c:387: error: â??PGRES\_COPY\_INâ?? undeclared (first use in this  
function)  
postgres.c:388: error: â??PGRES\_EMPTY\_QUERYâ?? undeclared (first use in this  
function)  
postgres.c:389: error: â??PGRES\_COMMAND\_OKâ?? undeclared (first use in this  
function)  
postgres.c:392: error: â??PGRES\_BAD\_RESPONSEâ?? undeclared (first use in  
this function)  
postgres.c:393: error: â??PGRES\_FATAL\_ERRORâ?? undeclared (first use in this  
function)  
postgres.c:394: error: â??PGRES\_NONFATAL\_ERRORâ?? undeclared (first use in  
this function)  
postgres.c:395: warning: assignment makes pointer from integer without a  
cast  
postgres.c: In function â??pgconn\_get\_notifyâ??:  
postgres.c:425: error: â??PGnotifyâ?? undeclared (first use in this  
function)  
postgres.c:425: error: â??notifyâ?? undeclared (first use in this function)  
postgres.c: In function â??pgconn\_insert\_tableâ??:  
postgres.c:450: error: â??PGconnâ?? undeclared (first use in this function)  
postgres.c:450: error: â??connâ?? undeclared (first use in this function)  
postgres.c:451: error: â??PGresultâ?? undeclared (first use in this  
function)  
postgres.c:451: error: â??resultâ?? undeclared (first use in this function)  
postgres.c:471: warning: passing argument 2 of â??rb\_raiseâ?? makes pointer  
from integer without a cast  
postgres.c: In function â??pgconn\_getlineâ??:  
postgres.c:511: error: â??PGconnâ?? undeclared (first use in this function)  
postgres.c:511: error: â??connâ?? undeclared (first use in this function)  
postgres.c: In function â??pgconn\_notifiesâ??:  
postgres.c:550: error: â??PGnotifyâ?? undeclared (first use in this  
function)  
postgres.c:550: error: â??notifiesâ?? undeclared (first use in this  
function)  
postgres.c: In function â??pgconn\_hostâ??:  
postgres.c:558: warning: initialization makes pointer from integer  
without a cast  
postgres.c: In function â??pgconn\_portâ??:  
postgres.c:567: warning: initialization makes pointer from integer  
without a cast  
postgres.c: In function â??pgconn\_dbâ??:  
postgres.c:575: warning: initialization makes pointer from integer  
without a cast  
postgres.c: In function â??pgconn\_optionsâ??:  
postgres.c:584: warning: initialization makes pointer from integer  
without a cast  
postgres.c: In function â??pgconn\_ttyâ??:  
postgres.c:593: warning: initialization makes pointer from integer  
without a cast  
postgres.c: In function â??pgconn\_userâ??:  
postgres.c:602: warning: initialization makes pointer from integer  
without a cast  
postgres.c: In function â??pgconn\_errorâ??:  
postgres.c:619: warning: initialization makes pointer from integer  
without a cast  
postgres.c: In function â??pgconn\_client\_encodingâ??:  
postgres.c:651: warning: cast to pointer from integer of different size  
postgres.c: At top level:  
postgres.c:669: error: syntax error before â??PGresultâ??  
postgres.c:669: warning: data definition has no type or storage class  
postgres.c:670: error: syntax error before â??{â?? token  
postgres.c:676: error: syntax error before â??PGresultâ??  
postgres.c:676: warning: data definition has no type or storage class  
postgres.c:679: error: syntax error before â??{â?? token  
postgres.c:683: error: â??valuestrâ?? undeclared here (not in a function)  
postgres.c:683: error: initializer element is not constant  
postgres.c:683: warning: data definition has no type or storage class  
postgres.c:684: error: syntax error before â??}â?? token  
postgres.c:693: error: syntax error before â??PGresultâ??  
postgres.c:693: warning: data definition has no type or storage class  
postgres.c:694: error: syntax error before â??{â?? token  
postgres.c: In function â??pgresult\_resultâ??:  
postgres.c:712: error: â??PGresultâ?? undeclared (first use in this  
function)  
postgres.c: In function â??pgresult\_eachâ??:  
postgres.c:736: error: â??PGresultâ?? undeclared (first use in this  
function)  
postgres.c: In function â??pgresult\_arefâ??:  
postgres.c:760: error: â??PGresultâ?? undeclared (first use in this  
function)  
postgres.c: In function â??pgresult\_fieldsâ??:  
postgres.c:795: error: â??PGresultâ?? undeclared (first use in this  
function)  
postgres.c:803: warning: passing argument 1 of â??rb\_tainted\_str\_new2â??  
makes pointer from integer without a cast  
postgres.c: In function â??pgresult\_fieldnameâ??:  
postgres.c:832: error: â??PGresultâ?? undeclared (first use in this  
function)  
postgres.c:840: warning: assignment makes pointer from integer without a  
cast  
postgres.c: In function â??pgresult\_typeâ??:  
postgres.c:863: error: â??PGresultâ?? undeclared (first use in this  
function)  
postgres.c: In function â??pgresult\_sizeâ??:  
postgres.c:879: error: â??PGresultâ?? undeclared (first use in this  
function)  
postgres.c: In function â??pgresult\_getvalueâ??:  
postgres.c:895: error: â??PGresultâ?? undeclared (first use in this  
function)  
postgres.c: In function â??pgresult\_getlengthâ??:  
postgres.c:914: error: â??PGresultâ?? undeclared (first use in this  
function)  
postgres.c: In function â??pgresult\_getisnullâ??:  
postgres.c:932: error: â??PGresultâ?? undeclared (first use in this  
function)  
postgres.c: In function â??pgresult\_printâ??:  
postgres.c:953: error: â??PQprintOptâ?? undeclared (first use in this  
function)  
postgres.c:953: error: syntax error before â??poâ??  
postgres.c:959: error: â??poâ?? undeclared (first use in this function)  
postgres.c: In function â??pgresult\_cmdtuplesâ??:  
postgres.c:1015: warning: passing argument 1 of â??strtolâ?? makes pointer  
from integer without a cast  
postgres.c: In function â??pgresult\_cmdstatusâ??:  
postgres.c:1023: warning: passing argument 1 of â??rb\_tainted\_str\_new2â??  
makes pointer from integer without a cast  
postgres.c: At top level:  
postgres.c:1046: error: syntax error before â??\*â?? token  
postgres.c: In function â??get\_pglargeâ??:  
postgres.c:1050: error: â??pglargeâ?? undeclared (first use in this  
function)  
postgres.c:1051: error: syntax error before â??)â?? token  
postgres.c: In function â??pgconn\_loimportâ??:  
postgres.c:1060: error: â??Oidâ?? undeclared (first use in this function)  
postgres.c:1060: error: syntax error before â??lo\_oidâ??  
postgres.c:1062: error: â??PGconnâ?? undeclared (first use in this function)  
postgres.c:1062: error: â??connâ?? undeclared (first use in this function)  
postgres.c:1068: warning: passing argument 2 of â??rb\_raiseâ?? makes pointer  
from integer without a cast  
postgres.c: In function â??pgconn\_loexportâ??:  
postgres.c:1077: error: â??PGconnâ?? undeclared (first use in this function)  
postgres.c:1077: error: â??connâ?? undeclared (first use in this function)  
postgres.c:1087: warning: passing argument 2 of â??rb\_raiseâ?? makes pointer  
from integer without a cast  
postgres.c: In function â??pgconn\_locreateâ??:  
postgres.c:1098: error: â??Oidâ?? undeclared (first use in this function)  
postgres.c:1098: error: syntax error before â??lo\_oidâ??  
postgres.c:1101: error: â??PGconnâ?? undeclared (first use in this function)  
postgres.c:1101: error: â??connâ?? undeclared (first use in this function)  
postgres.c:1104: error: â??INV\_READâ?? undeclared (first use in this  
function)  
postgres.c: In function â??pgconn\_loopenâ??:  
postgres.c:1125: error: â??Oidâ?? undeclared (first use in this function)  
postgres.c:1125: error: syntax error before â??lo\_oidâ??  
postgres.c:1128: error: â??PGconnâ?? undeclared (first use in this function)  
postgres.c:1128: error: â??connâ?? undeclared (first use in this function)  
postgres.c:1133: error: â??INV\_READâ?? undeclared (first use in this  
function)  
postgres.c: In function â??pgconn\_lounlinkâ??:  
postgres.c:1156: error: â??PGconnâ?? undeclared (first use in this function)  
postgres.c:1156: error: â??connâ?? undeclared (first use in this function)  
postgres.c: At top level:  
postgres.c:1171: error: syntax error before â??PGlargeâ??  
postgres.c:1171: warning: data definition has no type or storage class  
postgres.c:1172: error: syntax error before â??{â?? token  
postgres.c:1176: warning: parameter names (without types) in function  
declaration  
postgres.c:1176: error: conflicting types for â??freeâ??  
/usr/include/stdlib.h:597: error: previous declaration of â??freeâ?? was  
here  
postgres.c:1176: warning: data definition has no type or storage class  
postgres.c:1177: error: syntax error before â??}â?? token  
postgres.c:1181: error: syntax error before â??PGconnâ??  
postgres.c:1181: warning: data definition has no type or storage class  
postgres.c:1182: error: syntax error before â??lo\_oidâ??  
postgres.c:1182: warning: data definition has no type or storage class  
postgres.c:1184: error: syntax error before â??{â?? token  
postgres.c:1186: warning: data definition has no type or storage class  
postgres.c:1188: error: syntax error before â??)â?? token  
postgres.c: In function â??pglarge\_oidâ??:  
postgres.c:1200: error: invalid operands to binary \*  
postgres.c:1202: error: request for member â??lo\_oidâ?? in something not a  
structure or union  
postgres.c: In function â??pglarge\_openâ??:  
postgres.c:1211: error: invalid operands to binary \*  
postgres.c:1217: error: â??INV\_READâ?? undeclared (first use in this  
function)  
postgres.c:1223: error: request for member â??pgconnâ?? in something not a  
structure or union  
postgres.c:1223: error: request for member â??lo\_oidâ?? in something not a  
structure or union  
postgres.c:1226: error: request for member â??lo\_fdâ?? in something not a  
structure or union  
postgres.c:1228: error: request for member â??lo\_fdâ?? in something not a  
structure or union  
postgres.c: In function â??pglarge\_closeâ??:  
postgres.c:1235: error: invalid operands to binary \*  
postgres.c:1237: error: request for member â??pgconnâ?? in something not a  
structure or union  
postgres.c:1237: error: request for member â??lo\_fdâ?? in something not a  
structure or union  
postgres.c: In function â??pglarge\_tellâ??:  
postgres.c:1250: error: invalid operands to binary \*  
postgres.c:1252: error: request for member â??pgconnâ?? in something not a  
structure or union  
postgres.c:1252: error: request for member â??lo\_fdâ?? in something not a  
structure or union  
postgres.c: In function â??loread\_allâ??:  
postgres.c:1262: error: invalid operands to binary \*  
postgres.c:1270: error: request for member â??pgconnâ?? in something not a  
structure or union  
postgres.c:1270: error: request for member â??lo\_fdâ?? in something not a  
structure or union  
postgres.c: In function â??pglarge\_readâ??:  
postgres.c:1289: error: invalid operands to binary \*  
postgres.c:1304: error: request for member â??pgconnâ?? in something not a  
structure or union  
postgres.c:1304: error: request for member â??lo\_fdâ?? in something not a  
structure or union  
postgres.c: In function â??pglarge\_writeâ??:  
postgres.c:1317: error: invalid operands to binary \*  
postgres.c:1324: error: request for member â??pgconnâ?? in something not a  
structure or union  
postgres.c:1324: error: request for member â??lo\_fdâ?? in something not a  
structure or union  
postgres.c: In function â??pglarge\_seekâ??:  
postgres.c:1335: error: invalid operands to binary \*  
postgres.c:1338: error: request for member â??pgconnâ?? in something not a  
structure or union  
postgres.c:1338: error: request for member â??lo\_fdâ?? in something not a  
structure or union  
postgres.c: In function â??pglarge\_sizeâ??:  
postgres.c:1349: error: invalid operands to binary \*  
postgres.c:1352: error: request for member â??pgconnâ?? in something not a  
structure or union  
postgres.c:1352: error: request for member â??lo\_fdâ?? in something not a  
structure or union  
postgres.c:1356: error: request for member â??pgconnâ?? in something not a  
structure or union  
postgres.c:1356: error: request for member â??lo\_fdâ?? in something not a  
structure or union  
postgres.c:1360: error: request for member â??pgconnâ?? in something not a  
structure or union  
postgres.c:1360: error: request for member â??lo\_fdâ?? in something not a  
structure or union  
postgres.c: In function â??pglarge\_exportâ??:  
postgres.c:1371: error: invalid operands to binary \*  
postgres.c:1375: error: request for member â??pgconnâ?? in something not a  
structure or union  
postgres.c:1375: error: request for member â??lo\_oidâ?? in something not a  
structure or union  
postgres.c:1376: error: request for member â??pgconnâ?? in something not a  
structure or union  
postgres.c:1376: warning: passing argument 2 of â??rb\_raiseâ?? makes pointer  
from integer without a cast  
postgres.c: In function â??pglarge\_unlinkâ??:  
postgres.c:1386: error: invalid operands to binary \*  
postgres.c:1388: error: request for member â??pgconnâ?? in something not a  
structure or union  
postgres.c:1388: error: request for member â??lo\_oidâ?? in something not a  
structure or union  
postgres.c:1389: error: request for member â??pgconnâ?? in something not a  
structure or union  
postgres.c:1389: warning: passing argument 2 of â??rb\_raiseâ?? makes pointer  
from integer without a cast  
postgres.c: In function â??Init\_postgresâ??:  
postgres.c:1418: error: â??CONNECTION\_OKâ?? undeclared (first use in this  
function)  
postgres.c:1419: error: â??CONNECTION\_BADâ?? undeclared (first use in this  
function)  
postgres.c:1476: error: â??INV\_WRITEâ?? undeclared (first use in this  
function)  
postgres.c:1477: error: â??INV\_READâ?? undeclared (first use in this  
function)  
postgres.c:1486: error: â??PGRES\_EMPTY\_QUERYâ?? undeclared (first use in  
this function)  
postgres.c:1487: error: â??PGRES\_COMMAND\_OKâ?? undeclared (first use in this  
function)  
postgres.c:1488: error: â??PGRES\_TUPLES\_OKâ?? undeclared (first use in this  
function)  
postgres.c:1489: error: â??PGRES\_COPY\_OUTâ?? undeclared (first use in this  
function)  
postgres.c:1490: error: â??PGRES\_COPY\_INâ?? undeclared (first use in this  
function)  
postgres.c:1491: error: â??PGRES\_BAD\_RESPONSEâ?? undeclared (first use in  
this function)  
postgres.c:1492: error: â??PGRES\_NONFATAL\_ERRORâ?? undeclared (first use in  
this function)  
postgres.c:1493: error: â??PGRES\_FATAL\_ERRORâ?? undeclared (first use in  
this function)  
make: \*\*\* [postgres.o] Error 1  
ruby extconf.rb install postgres –  
–include-dir=/usr/include/postgresql  
checking for cygwin32\_socket() in -lwsock32… no  
checking for socket() in -lsocket… no  
checking for gethostbyname() in -linet… no  
checking for gethostbyname() in -lnsl… yes  
checking for sys/un.h… yes  
checking for socket()… yes  
checking for hsterror()… no  
checking for gethostname()… yes  
checking for PQsetdbLogin() in -lpq… yes  
checking for PQsetClientEncoding()… yes  
checking for pg\_encoding\_to\_char()… yes  
checking for PQescapeString()… yes  
creating Makefile

make  
gcc -fPIC -I. -I/usr/lib/ruby/1.8/x86\_64-linux  
-I/usr/lib/ruby/1.8/x86\_64-linux -I. -DHAVE\_SYS\_UN\_H -DHAVE\_SOCKET  
-DHAVE\_GETHOSTNAME -DHAVE\_PQSETCLIENTENCODING -DHAVE\_PG\_ENCODING\_TO\_CHAR  
-DHAVE\_PQESCAPESTRING -c postgres.c

make install  
gcc -fPIC -I. -I/usr/lib/ruby/1.8/x86\_64-linux  
-I/usr/lib/ruby/1.8/x86\_64-linux -I. -DHAVE\_SYS\_UN\_H -DHAVE\_SOCKET  
-DHAVE\_GETHOSTNAME -DHAVE\_PQSETCLIENTENCODING -DHAVE\_PG\_ENCODING\_TO\_CHAR  
-DHAVE\_PQESCAPESTRING -c postgres.c

make clean  
Successfully installed postgres-0.7.1
