Error while installing ruby-postgres gem

Hi,

I am new to Ruby on Rails. I am running rails on Mac OSX 10.5.7.

I get an error when I run this command sudo gem install ruby-postgres

The error is as follows

/System/Library/Frameworks/Ruby.framework/Versions/1.8/usr/bin/ruby
extconf.rb
checking for main() in -lpq… yes
checking for libpq-fe.h… yes
checking for libpq/libpq-fs.h… yes
checking for PQsetClientEncoding()… yes
checking for pg_encoding_to_char()… yes
checking for PQfreemem()… yes
checking for PQescapeString()… yes
checking for PQexecParams()… yes
creating Makefile

make
gcc -I. -I.
-I/System/Library/Frameworks/Ruby.framework/Versions/1.8/usr/lib/ruby/1.8/universal-darwin9.0
-I. -DHAVE_LIBPQ_FE_H -DHAVE_LIBPQ_LIBPQ_FS_H -DHAVE_PQSETCLIENTENCODING
-DHAVE_PG_ENCODING_TO_CHAR -DHAVE_PQFREEMEM -DHAVE_PQESCAPESTRING
-DHAVE_PQEXECPARAMS -I/Library/PostgreSQL/8.3/include -fno-common
-arch ppc -arch i386 -Os -pipe -fno-common -Wall -c postgres.c
postgres.c:31: error: conflicting types for ‘pg_encoding_to_char’
/Library/PostgreSQL/8.3/include/libpq-fe.h:518: error: previous
declaration of ‘pg_encoding_to_char’ was here
postgres.c:31: error: conflicting types for ‘pg_encoding_to_char’
/Library/PostgreSQL/8.3/include/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_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
postgres.c: In function ‘pgconn_s_unescape_bytea’:
postgres.c:401: warning: pointer targets in passing argument 1 of
‘PQunescapeBytea’ differ in signedness
lipo: can’t open input file: /var/tmp//ccGQscbS.out (No such file or
directory)
make: *** [postgres.o] Error 1

Any help is really appreciated.

Thanks a lot
Jai

This command worked for me
sudo gem install --include-dependencies postgres

I think it is a good idea to always include dependencies :slight_smile:

Jai

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