2

当这个奇怪的错误跳出来时,我试图在 Mountain Lion 中进行捆绑更新:

Gem::Installer::ExtensionBuildError: ERROR: Failed to build gem native extension.

        /Volumes/MacintoshHD/Users/wlicpsc/.rvm/rubies/ruby-1.9.3-p194/bin/ruby extconf.rb 
checking for pg_config... yes
Using config values from /Library/PostgreSQL/9.1/bin/pg_config
checking for libpq-fe.h... yes
checking for libpq/libpq-fs.h... yes
checking for pg_config_manual.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 PQescapeLiteral()... yes
checking for PQescapeIdentifier()... yes
checking for PQgetCancel()... yes
checking for lo_create()... yes
checking for pg_encoding_to_char()... yes
checking for pg_char_to_encoding()... yes
checking for PQsetClientEncoding()... yes
checking for PQlibVersion()... yes
checking for PQping()... yes
checking for rb_encdb_alias()... yes
checking for rb_enc_alias()... no
checking for PGRES_COPY_BOTH in libpq-fe.h... yes
checking for PGRES_SINGLE_TUPLE in libpq-fe.h... no
checking for struct pgNotify.extra in libpq-fe.h... yes
checking for unistd.h... yes
checking for ruby/st.h... yes
creating extconf.h
creating Makefile

make
compiling pg.c
compiling pg_connection.c
pg_connection.c: In function ‘pgconn_wait_for_notify’:
pg_connection.c:2064: warning: ‘rb_thread_select’ is deprecated (declared at /Volumes/MacintoshHD/Users/wlicpsc/.rvm/rubies/ruby-1.9.3-p194/include/ruby-1.9.1/ruby/intern.h:379)
pg_connection.c: In function ‘pgconn_block’:
pg_connection.c:2594: warning: ‘rb_thread_select’ is deprecated (declared at /Volumes/MacintoshHD/Users/wlicpsc/.rvm/rubies/ruby-1.9.3-p194/include/ruby-1.9.1/ruby/intern.h:379)
compiling pg_result.c
linking shared-object pg_ext.bundle
ld: in /opt/local/lib/libsasl2.2.dylib, file was built for unsupported file format ( 0xce 0xfa 0xed 0xfe 0x 7 0x 0 0x 0 0x 0 0x 3 0x 0 0x 0 0x 0 0x 6 0x 0 0x 0 0x 0 ) which is not the architecture being linked (x86_64): /opt/local/lib/libsasl2.2.dylib for architecture x86_64
collect2: ld returned 1 exit status
make: *** [pg_ext.bundle] Error 1

...好吧,有点长,但关键在这里:/opt/local/lib/libsasl2.2.dylib 似乎与架构不匹配。我检查了关于 libssl 的类似问题,但这个问题更加罕见。我没有使用 Brew。有什么建议么?非常感谢。

4

1 回答 1

1

首先使用 OS X 安装程序安装 postgresSQL: http ://www.enterprisedb.com/products-services-training/pgdownload

然后使用该命令安装 postgres gem(只需记住将版本(9.1)更改为您的:

PATH=$PATH:/Library/PostgreSQL/9.1/bin/ gem install pg
于 2012-09-05T07:21:29.570 回答