无法在OS X El Capitan上安装节俭宝石 [英] Can't install thrift gem on OS X El Capitan

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

问题描述

  $ gem install thrift 
构建原生扩展。这可能需要一段时间...
错误:安装节俭错误:
错误:无法构建gem本机扩展。

/Users/foo/.rvm/rubies/ruby-2.1.4/bin/ruby -r ./siteconf20160402-32256-7dzqel.rb extconf.rb
检查strlcpy() in string.h ...是
创建Makefile

makeDESTDIR =clean

makeDESTDIR =
编译binary_protocol_accelerated.c
编译bytes.c
编译compact_protocol.c
compact_protocol.c:442:41:错误:移动一个负的有符号值是未定义的[-Werror,-Wshift-negative-value]
rb_exc_raise(get_protocol_exception(INT2FIX(-1),rb_str_new2(buf)));
^ ~~~~~~~~~~

编译失败,
compact_protocol.c:442:41:error:移动一个负的有符号值是未定义的[-Werror,-Wshift-negative-value]

解决方案

我有你的解决方案!希望如此。



前些日子有同样的问题。



问题出在clang编译器中,El Capitan捆绑在一起。我敢肯定,它解决了其他问题,但这是我遇到很多问题的一点。



请尝试运行以下命令并让我知道它是怎么回事!

  gem install thrift  -  --with-cppflags = \-D_FORTIFY_SOURCE = 0 -Wno-shift-negative-值\


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)));
                                            ^~~~~~~~~~~

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.

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上安装节俭宝石的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

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