尝试在OSX El Capitan升级后安装thift gem:
$gem install thrift Building native extensions. This could take a while... ERROR: Error installing thrift: ERROR: @R_403_159@ 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]
解决方法
我有一个解决方案给你!希望.
有一天有同样的问题.
问题在于El Capitan捆绑的clang编译器.我确定它拧紧了其他问题,但这是一个问题,我有很多问题.
尝试运行以下命令,让我知道它是怎么回事!
gem install thrift -- --with-cppflags=\"-D_FORTIFY_SOURCE=0 -Wno-shift-negative-value\"