错误:无法在 Mavericks 上构建 gem 本机扩展

2023-12-26

我正在尝试跑步bundle在我的 OSX 10.9 上的 Rails 项目中。到达时失败pg宝石出现此错误:

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

    /Users/kyledecot/.rvm/rubies/ruby-2.0.0-p247/bin/ruby extconf.rb
checking for pg_config... no
No pg_config... trying anyway. If building fails, please try again with
 --with-pg-config=/path/to/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()... no
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... no
checking for PGRES_SINGLE_TUPLE in libpq-fe.h... no
checking for PG_DIAG_TABLE_NAME 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 "DESTDIR="
compiling gvl_wrappers.c
clang: warning: argument unused during compilation: '-fno-fast-math'
compiling pg.c
clang: warning: argument unused during compilation: '-fno-fast-math'
pg.c:272:9: warning: implicit declaration of function 'PQlibVersion' is invalid in C99 [-Wimplicit-function-declaration]
        return INT2NUM(PQlibVersion());
               ^
In file included from pg.c:48:
In file included from ./pg.h:17:
In file included from /Users/kyledecot/.rvm/rubies/ruby-2.0.0-p247/include/ruby-2.0.0/ruby.h:33:
/Users/kyledecot/.rvm/rubies/ruby-2.0.0-p247/include/ruby-2.0.0/ruby/ruby.h:1167:21: note: instantiated from:
# define INT2NUM(v) INT2FIX((int)(v))
                    ^
pg.c:272:9: note: instantiated from:
        return INT2NUM(PQlibVersion());
               ^
pg.c:272:17: note: instantiated from:
        return INT2NUM(PQlibVersion());
                       ^
pg.c:375:48: error: use of undeclared identifier 'PQPING_OK'
        rb_define_const(rb_mPGconstants, "PQPING_OK", INT2FIX(PQPING_OK));
                                                      ^
pg.c:375:56: note: instantiated from:
        rb_define_const(rb_mPGconstants, "PQPING_OK", INT2FIX(PQPING_OK));
                                                              ^
pg.c:377:52: error: use of undeclared identifier 'PQPING_REJECT'
        rb_define_const(rb_mPGconstants, "PQPING_REJECT", INT2FIX(PQPING_REJECT));
                                                          ^
pg.c:377:60: note: instantiated from:
        rb_define_const(rb_mPGconstants, "PQPING_REJECT", INT2FIX(PQPING_REJECT));
                                                                  ^
pg.c:379:57: error: use of undeclared identifier 'PQPING_NO_RESPONSE'
        rb_define_const(rb_mPGconstants, "PQPING_NO_RESPONSE", INT2FIX(PQPING_NO_RESPONSE));
                                                               ^
pg.c:379:65: note: instantiated from:
        rb_define_const(rb_mPGconstants, "PQPING_NO_RESPONSE", INT2FIX(PQPING_NO_RESPONSE));
                                                                       ^
pg.c:381:56: error: use of undeclared identifier 'PQPING_NO_ATTEMPT'
        rb_define_const(rb_mPGconstants, "PQPING_NO_ATTEMPT", INT2FIX(PQPING_NO_ATTEMPT));
                                                              ^
pg.c:381:64: note: instantiated from:
        rb_define_const(rb_mPGconstants, "PQPING_NO_ATTEMPT", INT2FIX(PQPING_NO_ATTEMPT));
                                                                      ^
1 warning and 4 errors generated.
make: *** [pg.o] Error 1


Gem files will remain installed in /Users/kyledecot/.rvm/gems/ruby-2.0.0-p247@skateboxes/gems/pg-0.17.0 for inspection.
Results logged to /Users/kyledecot/.rvm/gems/ruby-2.0.0-p247@skateboxes/gems/pg-0.17.0/ext/gem_make.out

An error occurred while installing pg (0.17.0), and Bundler cannot continue.
Make sure that `gem install pg -v '0.17.0'` succeeds before bundling.

另请确保您已升级 Xcode 以在 Mavericks 上重新安装命令行工具。 在终端类型中:

xcode-select --install

然后按照提示操作。

本文内容由网友自发贡献,版权归原作者所有,本站不承担相应法律责任。如您发现有涉嫌抄袭侵权的内容,请联系:hwhale#tublm.com(使用前将#替换为@)

错误:无法在 Mavericks 上构建 gem 本机扩展 的相关文章

随机推荐

  • 在 NTFS 中搜索文件

    我们有一个相当大的磁盘阵列 上面大约有 2 3 百万个 XML 文件 磁盘采用 NTFS 格式 我们想使用通配符搜索文件系统 因此 像 SomePartOfTheFilename 这样的内容将是典型的搜索查询 我们正在使用 Net 并且发现
  • React-选择清除值,同时保留过滤器

    我正在开发一个权限系统 让用户控制谁可以访问 评论 编辑资源 就像您在 Google 云端硬盘上找到的资源一样 我正在使用 React Select multi 让资源所有者选择他想要授予资源访问权限的用户 当我单击反应选择显示的选项时 我
  • Android 中的隐式意图与显式意图(startActivity(intent) 崩溃)

    我是这个世界的新人 我在使用 startActivity intent 时遇到问题 这是清单
  • 按下时更改按钮主题

    我试图在按下按钮时更改按钮的数据主题 我在按钮的 onClick 处理程序中调用此 JavaScript 函数 function changeNextButtonColor var nextButton document getElemen
  • 在另一个类中使用 JSONArray?

    我有一个微调器 可以在下拉列表中加载客户的姓名 微调器从 JSON 数组获取字符串 我还有一些文本视图 当旋转器选择更改时 应加载所选客户的姓名 地址 电话号码 但是 JSONArray 在另一个类中使用 我如何在另一个类中使用 JSONA
  • 在 Visual Studio 2015 中显示单元测试的描述属性

    有谁知道如何在 Visual Studio 2015 测试运行期间显示描述属性 例如给出这个测试 TestMethod TestCategory With Fakes Description Posting a blog entry wit
  • TIME-WAIT刺杀和SO_REUSEADDR有什么区别

    我正在阅读有关使用 SO LINGER 套接字选项通过将逗留时间设置为零来有意 暗杀 时间等待状态的内容 该书的作者接着说我们永远不应该这样做 并且一般来说我们永远不应该干扰时间等待状态 然后他立即建议使用 SO REUSEADDR 选项来
  • 改造通用服务接口

    我正在为 Retrofit 创建一个通用 API 层 这是我的服务类别 public interface ApiService POST api authenticate Call
  • Firefox 上奇怪的蓝色边框

    请看一下这段代码 http www jsfiddle net tt13 5CxPr 21 http www jsfiddle net tt13 5CxPr 21 On Firefox it shows strange blue border
  • 在特定年份 Pandas 之后删除行

    我的数据框中有一列 其中包含以下格式的年份 2018 19 2017 18 年份是对象数据类型 我想将此列的类型更改为日期时间 然后删除 1979 80 之前的所有行 但是 我尝试这样做 但出现了格式错误 这样做的正确或更好的方法是什么 B
  • JavaScript 中判断某物是否为普通对象的方法

    我最近偶然发现了这个函数 它可以确定某个东西是否是普通对象 JavaScript function isPlainObject value if typeof value object value null return false let
  • Visual Studio:使用一个宏进行清理和重建

    我正在尝试通过创建一些宏来优化 VS 的工作 目前我有以下宏 Public Sub ReleaseBuild DTE ExecuteCommand Build SolutionConfigurations Release DTE Execu
  • 如何在 Dart 中将“ByteData”实例写入文件?

    我正在使用 Flutter 将 资产 加载到File以便本机应用程序可以访问它 这就是我加载资产的方式 final dbBytes await rootBundle load assets file 这将返回一个实例ByteData 我怎样
  • 如何在 TKinter 中显示控制台输出?

    我希望控制台中的显示显示在 GUI Tkinter 中 它应该在输出到 Python 控制台时准确显示 而不是在项目完成后显示 你能用 Tkinter 做到这一点吗 或者还有其他选择吗 这些是我当前的输出 这些应该实时显示在 GUI 上 S
  • 使用 Interop 从 Excel 获取最后一个非空列和行索引

    我正在尝试使用互操作库从 Excel 文件中删除所有多余的空白行和列 我关注了这个问题使用 Interop 从 Excel 文件中删除空行和空列的最快方法 https stackoverflow com questions 40574084
  • 使用 getchar() 输入字符串

    以下代码使用 getchar 接受一行输入 include
  • sqlite 通过 c++,打开多个 sqlite 文件

    如何在 C C 中将多个 sqlite 文件连接到单个 sqlite3 句柄 我认为考虑到有一个名为 ATTACH 的命令是可能的 但不知道如何在 C 中执行此操作 提前致谢 答案 感谢罗伯特 sqlite3 exec db ATTACH
  • 没有“使用使用情况数据的应用”或 android.settings.USAGE_ACCESS_SETTINGS 意图的设备

    背景 Android 5 引入了新的使用情况统计 https developer android com reference android app usage UsageStatsManager html可用于查询不同应用程序花费时间的
  • jquery移动页面注入

    我有这个简单的 html 我正在托管我自己的文件并且它可以工作
  • 错误:无法在 Mavericks 上构建 gem 本机扩展

    我正在尝试跑步bundle在我的 OSX 10 9 上的 Rails 项目中 到达时失败pg宝石出现此错误 Gem Installer ExtensionBuildError ERROR Failed to build gem native