节俭红宝石宝石 [英] Thrift Ruby gem

查看:70
本文介绍了节俭红宝石宝石的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

我一生都无法成功运行gem install thrift",在构建 gem 的本机扩展时失败;这是输出:

I cannot, for the life of me, successfully run "gem install thrift", the thing fails when building the gem's native extensions; this is the output:

(acib708) ~ -> gem install thrift
Building native extensions.  This could take a while...
ERROR:  Error installing thrift:
    ERROR: Failed to build gem native extension.

    /Users/acib708/.rvm/rubies/ruby-2.0.0-p247/bin/ruby extconf.rb
extconf.rb:25:in `<main>': Use RbConfig instead of obsolete and deprecated Config.
extconf.rb:25:in `<main>': Use RbConfig instead of obsolete and deprecated Config.
checking for strlcpy() in string.h... yes
creating Makefile

make "DESTDIR="
compiling binary_protocol_accelerated.c
compiling bytes.c
compiling compact_protocol.c
compiling memory_buffer.c
compiling protocol.c
compiling strlcpy.c
                                           ^

(...)

In file included from strlcpy.c:20:
./strlcpy.h:28:15: error: conflicting types for '__builtin___strlcpy_chk'
/usr/include/secure/_string.h:105:3: note: expanded from macro 'strlcpy'
  __builtin___strlcpy_chk (dest, src, len, __darwin_obsz (dest))
  ^
./strlcpy.h:28:15: note: '__builtin___strlcpy_chk' is a builtin with type 'unsigned long (char *, const char *, unsigned long, unsigned long)'
/usr/include/secure/_string.h:105:3: note: expanded from macro 'strlcpy'
  __builtin___strlcpy_chk (dest, src, len, __darwin_obsz (dest))
  ^
4 errors generated.
make: *** [strlcpy.o] Error 1


Gem files will remain installed in /Users/acib708/.rvm/gems/ruby-2.0.0-p247/gems/thrift-0.9.1 for inspection.
Results logged to /Users/acib708/.rvm/gems/ruby-2.0.0-p247/gems/thrift-0.9.1/ext/gem_make.out

我在网上看到很多类似的错误,但我还没有找到解决方案.我正在运行 OS X 10.9,安装了全新的 rvm/ruby-2.0.0-p247.有任何想法吗?谢谢.

I've seen lots of similar errors around the web, but I haven't found the solution. I'm running OS X 10.9, with a fresh rvm/ruby-2.0.0-p247 install. Any ideas? Thanks.

推荐答案

目前的问题可以在 https://issues.apache.org/jira/browse/THRIFT-2219

作为使用 gems 的人的临时修复,您可以尝试将 #define'ing _FORTIFY_SOURCE 宏设置为 0 以使 strlcpy 成为函数而不是宏:

As a temporary fix for folks using gems, you can try setting the #define'ing the _FORTIFY_SOURCE macro to 0 to make strlcpy a function rather than a macro:

gem install thrift -- --with-cppflags='-D_FORTIFY_SOURCE=0'

或者,如果您使用的是 bundler,您可以通过以下方式在本地为 thrift 设置 cflags:

or if you're using bundler, you can set the cflags for thrift locally via:

bundle config build.thrift --with-cppflags='-D_FORTIFY_SOURCE=0'

这篇关于节俭红宝石宝石的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

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