gem install pg错误:无法理解Yosemite w / Ruby 2.1.5上的kern.osversion`14.0.0'

时间:2014-11-20 19:02:30

标签: ruby macos postgresql gcc

我使用RVM安装Ruby-2.1.5并再次运行bundle。现在pg gem没有安装,我收到了这个错误:

gem install pg -v '0.17.1' -- --with-pg-config=/Applications/Postgres.app/Contents/Versions/9.3/bin/pg_config
Building native extensions with: '--with-pg-config=/Applications/Postgres.app/Contents/Versions/9.3/bin/pg_config'
This could take a while...
ERROR:  Error installing pg:
    ERROR: Failed to build gem native extension.

    /Users/diego/.rvm/rubies/ruby-2.1.5/bin/ruby -r ./siteconf20141120-33258-108chh6.rb extconf.rb --with-pg-config=/Applications/Postgres.app/Contents/Versions/9.3/bin/pg_config
Using config values from /Applications/Postgres.app/Contents/Versions/9.3/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 PQsetSingleRowMode()... yes
checking for rb_encdb_alias()... yes
checking for rb_enc_alias()... yes
checking for rb_thread_call_without_gvl()... yes
checking for rb_thread_call_with_gvl()... yes
checking for rb_thread_fd_select()... yes
checking for rb_w32_wrap_io_handle()... no
checking for PGRES_COPY_BOTH in libpq-fe.h... yes
checking for PGRES_SINGLE_TUPLE in libpq-fe.h... yes
checking for PG_DIAG_TABLE_NAME in libpq-fe.h... yes
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 "DESTDIR=" clean

make "DESTDIR="
compiling gvl_wrappers.c
compiling pg.c
compiling pg_connection.c
compiling pg_errors.c
compiling pg_result.c
linking shared-object pg_ext.bundle
couldn't understand kern.osversion `14.0.0'
ld: warning: directory not found for option '-L/Users/mpapis/.sm/pkg/active/lib'
ld: -rpath can only be used when targeting Mac OS X 10.5 or later
collect2: ld returned 1 exit status
make: *** [pg_ext.bundle] Error 1

make failed, exit code 2

我已通过App Store将XCode更新到6.1版。我通过自制软件重新安装了gcc和applegcc-4.2。我还重新安装了Postgres.app。我尝试过建议的解决方案herehere无济于事。

任何人都知道下一步该尝试什么?现在我只是回到Ruby-2.1.4,pg安装得很好。

1 个答案:

答案 0 :(得分:13)

如果在编译MACOSX_DEPLOYMENT_TARGET=10.9 gem之前在环境中设置pg,则共享对象链接应该可以正常工作。