# Error while installing ruby-postgres gem

**URL:** <https://www.ruby-forum.com/t/error-while-installing-ruby-postgres-gem/173456>\
**Category:** Rails\
**Created:** [August 9, 2009, 5:42pm UTC](https://www.ruby-forum.com/t/error-while-installing-ruby-postgres-gem/173456 "2009-08-09T17:42:40Z")\
**Posts on this page:** 2\
**Page:** 1

<div class="post-metadata">

**Author:** ![jai](https://www.ruby-forum.com/letter_avatar_proxy/v4/letter/j/5f9b8f/32.png) [@jai](https://www.ruby-forum.com/u/jai)\
**Post date:** [August 9, 2009, 5:42pm UTC](https://www.ruby-forum.com/t/error-while-installing-ruby-postgres-gem/173456/1 "2009-08-09T17:42:40Z")

</div>

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

---

<div class="post-metadata">

**Author:** ![jai](https://www.ruby-forum.com/letter_avatar_proxy/v4/letter/j/5f9b8f/32.png) [@jai](https://www.ruby-forum.com/u/jai)\
**Post date:** [August 9, 2009, 9:55pm UTC](https://www.ruby-forum.com/t/error-while-installing-ruby-postgres-gem/173456/2 "2009-08-09T21:55:59Z")

</div>

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

I think it is a good idea to always include dependencies 🙂

Jai
