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: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
--
Posted via http://www.ruby-forum.com/.
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
# 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.