2

在 OSX 上构建最新的 Ruby 失败:

../.././ext/psych/yaml/api.c:11:12: error: use of undeclared identifier 'YAML_VERSION_STRING'
    return YAML_VERSION_STRING;
           ^
../.././ext/psych/yaml/api.c:21:14: error: use of undeclared identifier 'YAML_VERSION_MAJOR'
    *major = YAML_VERSION_MAJOR;
             ^
../.././ext/psych/yaml/api.c:22:14: error: use of undeclared identifier 'YAML_VERSION_MINOR'
    *minor = YAML_VERSION_MINOR;
             ^
../.././ext/psych/yaml/api.c:23:14: error: use of undeclared identifier 'YAML_VERSION_PATCH'
    *patch = YAML_VERSION_PATCH;

为什么会这样?源码没有测试吗?

4

1 回答 1

1

这可以通过添加#include "config.h"来解决...yaml/api.c

但随后会出现其他不同的错误。

我不明白为什么 ruby​​ 开发人员发布了不正确的源代码。

编辑更多信息:

似乎缺少某些定义(配置失败?)。通过添加其他错误已修复

#define HAVE_IFADDRS_H 1
#define HAVE_NET_IF_H 1

ext/socket/rubysocket.h. 在这些修复之后,编译运行良好。

于 2014-01-22T14:58:54.210 回答