rubygems/rubygems — Issue #228: installing pg - error: clang: error: linker command failed with exit code 1 (use -v to see invocation) make: *** [
Author: guidov2
Created: 2011-12-10 10:32:11+00:00
State: open

Hw: MACBOOK
Processore 2 Ghz Intel Core 2 Duo
Memoria 4 GB 667 MHz DDR2 SDRAM
Grafica Intel GMA 950 64 MB
Numero di serie 4H646HQ1WGL
Software Mac OS X Lion 10.7.2 (11C74)

Ruby version:
MacBook-Guido-2:~ guidov$ ruby --version
ruby 1.9.3p0 (2011-10-30 revision 33570) [x86_64-darwin11]
MacBook-Guido-2:~ guidov$

Installed via mac port

try to install pg I got this error:

MacBook-Guido-2:~ guidov$ sudo gem install pg
Building native extensions. This could take a while...
ERROR: Error installing pg:
ERROR: Failed to build gem native extension.
/opt/local/bin/ruby extconf.rb
checking for pg_config... yes
Using config values from /usr/bin/pg_config
checking for libpq-fe.h... yes
checking for libpq/libpq-fs.h... yes
checking for PQconnectdb() in -lpq... yes
checking for PQconnectionUsedPassword()... yes
checking for PQisthreadsafe()... yes
checking for PQprepare()... yes
checking for PQexecParams()... yes
checking for PQescapeString()... yes
checking for PQescapeStringConn()... yes
checking for PQgetCancel()... yes
checking for lo_create()... yes
checking for pg_encoding_to_char()... yes
checking for PQsetClientEncoding()... yes
checking for rb_encdb_alias()... yes
checking for rb_enc_alias()... no
checking for struct pgNotify.extra in libpq-fe.h... yes
checking for unistd.h... yes
creating extconf.h
creating Makefile
make
compiling compat.c
compiling pg.c
pg.c:2110:9: warning: 'rb_thread_select' is deprecated [-Wdeprecated-declarations]
ret = rb_thread_select( sd+1, &sd_rset, NULL, NULL, ptimeout );
^
pg.c:2585:26: warning: format string is not a string literal(potentially insecure) [-Wformat-security]
rb_raise( rb_ePGError, PQerrorMessage(conn) );
^~~~~~~~~~~~~~~~~~~~
pg.c:2591:15: warning: 'rb_thread_select' is deprecated [-Wdeprecated-declarations]
if ( (ret = rb_thread_select( sd+1, &sd_rset, NULL, NULL, ptimeout )) < 0 )
pg.c:2600:27: warning: format string is not a string literal(potentially insecure) [-Wformat-security]
rb_raise( rb_ePGError, PQerrorMessage(conn) );
^~~~~~~~~~~~~~~~~~~~
pg.c:3940:3: warning: implicit declaration of function 'rb_encdb_alias' is invalid in
C99 [-Wimplicit-function-declaration]
ENC_ALIAS(aliases[i], aliases[0]);
^
pg.c:3919:32: note: instantiated from:
# define ENC_ALIAS(name, orig) rb_encdb_alias((name), (orig))
^
5 warnings generated.
linking shared-object pg_ext.bundle
ld: in /usr/local/lib/libssl.0.9.8.dylib, missing required architecture x86_64 in file for architecture x86_64
clang: error: linker command failed with exit code 1 (use -v to see invocation)
make: *** [pg_ext.bundle] Error 1
Gem files will remain installed in /opt/local/lib/ruby1.9/gems/1.9.1/gems/pg-0.12.0 for inspection.
Results logged to /opt/local/lib/ruby1.9/gems/1.9.1/gems/pg-0.12.0/ext/gem_make.out
MacBook-Guido-2:~ guidov$

Best regards