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

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:

    postgres (0.7.1)
    The extension library to access a PostgreSQL database from Ruby.

  • 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:inrequire’
/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:inrequire_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:inrequire_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:inconnection_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:inretrieve_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:inmigrate’
/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:inexecute’
/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:insynchronize’
/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:inrun’
/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

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.

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

This forum is not affiliated to the Ruby language, Ruby on Rails framework, nor any Ruby applications discussed here.

| Privacy Policy | Terms of Service | Remote Ruby Jobs