installing ruby-postgres gem

12 views
Skip to first unread message

John Small

unread,
Feb 7, 2009, 1:32:26 AM2/7/09
to rubyonra...@googlegroups.com
I'm starting to look at postgres because I'm going to need it for its
GIS extensions. But I run in into a problem when trying to install the
ruby-postgres gem. I get this error

Building native extensions. This could take a while...
ERROR: Error installing ruby-postgres:
ERROR: Failed to build gem native extension.
blah
blah
blah etc
postgres.c:31: error: conflicting types for ‘pg_encoding_to_char’
/usr/include/postgresql/libpq-fe.h:518: error: previous declaration of
‘pg_encoding_to_char’ was here
postgres.c: In function ‘pgconn_s_escape_bytea’:
postgres.c:370: warning: pointer targets in passing argument 1 of
‘PQescapeBytea’ differ in signedness
postgres.c: In function ‘pgconn_s_unescape_bytea’:
postgres.c:401: warning: pointer targets in passing argument 1 of
‘PQunescapeBytea’ differ in signedness
make: *** [postgres.o] Error 1

Presumably some people have installed Postgresql and got it to work with
Ruby. Does anyone have any experience solving this problem?

Thanks

John Small
--
Posted via http://www.ruby-forum.com/.

Jorge Queiruga

unread,
Apr 8, 2009, 12:40:21 PM4/8/09
to rubyonra...@googlegroups.com
change /usr/include/libpq-fe.h (extern const char
*pg_encoding_to_char(int encoding); to extern char
*pg_encoding_to_char(int encoding);) # remove const

John Small

unread,
Apr 9, 2009, 1:56:50 AM4/9/09
to rubyonra...@googlegroups.com
Jorge Queiruga wrote:
> change /usr/include/libpq-fe.h (extern const char
> *pg_encoding_to_char(int encoding); to extern char
> *pg_encoding_to_char(int encoding);) # remove const

Thanks for that I've already switched to using the newer ruby-pg gem and
that seems OK.

Ta

John Small

Reply all
Reply to author
Forward
0 new messages