gem install pg错误:无法理解Yosemite上的kern.osversion`14.0.0'w / Ruby 2.1.5 [英] gem install pg error: couldn't understand kern.osversion `14.0.0' on Yosemite w/ Ruby 2.1.5

查看:98
本文介绍了gem install pg错误:无法理解Yosemite上的kern.osversion`14.0.0'w / Ruby 2.1.5的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

我使用RVM安装Ruby-2.1.5并再次运行软件包。现在pg gem不会安装,我得到这个错误:

  gem install pg -v'0.17.1' - --with-pg-config = / Applications / Postgres.app / Contents / Versions / 9.3 / bin / pg_config 
使用'--with-pg-config = / Applications / Postgres.app /目录构建原生扩展/Versions/9.3/bin/pg_config'
这可能需要一段时间...
错误:安装pg时出错:
错误:无法构建gem本机扩展。

/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
使用/Applications/Postgres.app/Contents/Versions/9.3/bin/pg_config中的配置值
检查libpq-fe.h ...是
检查libpq / libpq-fs.h ...是
检查pg_config_manual.h ...是
在-lpq中检查PQconnectdb()...是
检查PQconnectionUsedPassword()...是
检查PQisthreadsafe()...是
检查PQprepare()...是
检查PQexecParams().. 。
检查PQescapeString()...是
检查PQescapeStringConn()...是
检查PQescapeLiteral()...是
检查PQescapeIdentifier() ...是
检查PQgetCancel()...是
检查lo_create()...是
检查pg_encoding_to_char()...是
检查pg_char_to_encoding ()...是
检查PQsetClientE ncoding()...是
检查PQlibVersion()...是
检查PQping()...是
检查PQsetSingleRowMode()...是
检查rb_encdb_alias()...是
检查rb_enc_alias()...是
检查rb_thread_call_without_gvl()...是
检查rb_thread_call_with_gvl()...是
检查rb_thread_fd_select()...是
检查rb_w32_wrap_io_handle()... no
检查libpq-fe.h中的PGRES_COPY_BOTH ...是
检查libpq中的PGRES_SINGLE_TUPLE -fe.h ...是
在libpq-fe.h中检查PG_DIAG_TABLE_NAME ...是
在libpq-fe.h中检查struct pgNotify.extra ...是
检查for unistd.h ...是
检查ruby / st.h ...是
创建extconf.h
创建Makefile

makeDESTDIR = clean

makeDESTDIR =
编译gvl_wrappers.c
编译pg.c
编译pg_connection.c
编译pg_errors.c
编译pg_result.c
链接共享对象pg_ext.bund le
无法理解kern.osversion`14.0.0'
ld:warning:找不到选项'-L / Users / mpapis / .sm / pkg / active / lib'
ld:-rpath只能在定位到Mac OS X 10.5或更高版本时使用
collect2:ld返回1退出状态$ b $ make:*** [pg_ext.bundle]错误1

失败,退出代码2

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

任何人都知道接下来要做什么?现在我只是恢复到Ruby-2.1.4,其中pg安装正常。 如果将<$ c $在编译 pg gem之前,在您的环境中使用c> MACOSX_DEPLOYMENT_TARGET = 10.9 ,共享对象链接应该可以正常工作。


I used RVM to install Ruby-2.1.5 and ran bundle again. Now the pg gem won't install and I get this error:

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

I've updated XCode to version 6.1 via the App Store. I reinstalled gcc and applegcc-4.2 via homebrew. I also reinstall Postgres.app. I've tried the suggested solutions here and here to no avail.

Anybody have any idea what to try next? For now I'm just reverting to Ruby-2.1.4 where pg installs fine.

解决方案

If you set MACOSX_DEPLOYMENT_TARGET=10.9 in your environment prior to compiling the pg gem, the shared object linking should work properly.

这篇关于gem install pg错误:无法理解Yosemite上的kern.osversion`14.0.0'w / Ruby 2.1.5的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

查看全文
登录 关闭
扫码关注1秒登录
发送“验证码”获取 | 15天全站免登陆