无法在 OS X El Capitan 上安装 thrift gem [英] Can't install thrift gem on OS X El Capitan
问题描述
在 OSX El Capitan 升级后尝试安装 thift gem:
Trying to install thift gem after OSX El Capitan upgrade:
$ gem install thrift
Building native extensions. This could take a while...
ERROR: Error installing thrift:
ERROR: Failed to build gem native extension.
/Users/foo/.rvm/rubies/ruby-2.1.4/bin/ruby -r ./siteconf20160402-32256-7dzqel.rb extconf.rb
checking for strlcpy() in string.h... yes
creating Makefile
make "DESTDIR=" clean
make "DESTDIR="
compiling binary_protocol_accelerated.c
compiling bytes.c
compiling compact_protocol.c
compact_protocol.c:442:41: error: shifting a negative signed value is undefined [-Werror,-Wshift-negative-value]
rb_exc_raise(get_protocol_exception(INT2FIX(-1), rb_str_new2(buf)));
^~~~~~~~~~~
编译失败compact_protocol.c:442:41: 错误:移动负符号值未定义 [-Werror,-Wshift-negative-value]
Compilation fails with compact_protocol.c:442:41: error: shifting a negative signed value is undefined [-Werror,-Wshift-negative-value]
推荐答案
我有一个解决方案给你!希望.
I have a solution for you! Hopefully.
前几天也遇到了同样的问题.
Had this same problem the other day.
问题在于 El Capitan 捆绑的 clang 编译器.我确信它会解决其他问题,但这是我遇到很多问题的一点.
The problem is in the clang compiler that El Capitan comes bundled with. I'm sure it screws up other issues but this is one point that I had a lot of issues with.
尝试运行以下命令,让我知道结果如何!
Try running the following command and let me know how it goes!
gem install thrift -- --with-cppflags="-D_FORTIFY_SOURCE=0 -Wno-shift-negative-value"
这篇关于无法在 OS X El Capitan 上安装 thrift gem的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!