Warning: file_get_contents(/data/phpspider/zhask/data//catemap/4/postgresql/9.json): failed to open stream: No such file or directory in /data/phpspider/zhask/libs/function.php on line 167

Warning: Invalid argument supplied for foreach() in /data/phpspider/zhask/libs/tag.function.php on line 1116

Notice: Undefined index: in /data/phpspider/zhask/libs/function.php on line 180

Warning: array_chunk() expects parameter 1 to be array, null given in /data/phpspider/zhask/libs/function.php on line 181
Ruby on rails 安装pg gem 0.14.1时架构不匹配_Ruby On Rails_Postgresql_Osx Mountain Lion_Pg - Fatal编程技术网

Ruby on rails 安装pg gem 0.14.1时架构不匹配

Ruby on rails 安装pg gem 0.14.1时架构不匹配,ruby-on-rails,postgresql,osx-mountain-lion,pg,Ruby On Rails,Postgresql,Osx Mountain Lion,Pg,我正试图在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

我正试图在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。有什么建议吗?非常感谢。

首先使用OS X安装程序安装postgresSQL:

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

PATH=$PATH:/Library/PostgreSQL/9.1/bin/ gem install pg

升级到10.8后,您安装了吗?尝试过,看起来不起作用,相同的错误仍然存在。问题出在一些关于libsasl的文件上,这些文件似乎需要补丁或其他东西。不过感谢您的回复。