2013-10-29 3 views
11

내 인생에서 "보석 설치 중고품"을 성공적으로 실행할 수 없으며 보석의 기본 확장 기능을 구축 할 수 없습니다. 이것은 출력 :스 프릿 루비 보석

(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 

나는 웹 주위 유사한 오류를 많이 본 적이 있지만 나는 해결책을 발견하지 않았습니다. 새로운 rvm/ruby-2.0.0-p247 설치로 OS X 10.9를 실행 중입니다. 어떤 아이디어? 감사합니다. . 보석을 사용하는 사람들에 대한 임시 수정, 매크로보다는 strlcpy 함수를 만들기 위해 0으로 _FORTIFY_SOURCE 매크로를 define'ing 앞에 # 설정을 시도 할 수 있습니다으로

+1

XCode가 최신 버전입니까? – Vidya

+0

예, 최신 버전입니다. – acib708

+2

@ AlejandroCárdenas 답변 중 하나를 수락하십시오. 이 열심히 일하는 사람들은 시간을내어 당신을 도울 것입니다. 체크 마크 아이콘을 클릭하는 것만으로도 충분합니다. – nhed

답변

56

순간에 대한 문제는 https://issues.apache.org/jira/browse/THRIFT-2219

에서 찾을 수 있습니다 하십시오 workaro를 사용하기보다는

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

감사합니다. 이것은 나를 위해 일했다. – arnab

+3

나를 위해 일했습니다! 나는'bundle config' 명령을 실행하고'bundle install '을 다시 실행했다. –

+0

굉장합니다, 고마워요! –

3

: 당신은 들러를 사용하는 경우

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

또는, 당신은을 통해 로컬 절약을위한 CFLAGS를 설정할 수 있습니다 und와 cppflags 나는 __has_builtin (strlcpy)을 검사하고 시스템에 내장 함수가 없지만 strlcpy가 정의되어 있다면 이전에했던 것처럼 externs를 사용하는 수정을했다. 10.8, 10.9, CentOS는이, 우분투, ...

6

는 OS 10.9.4에서 명령 아래 나를 위해 일한 X 운영 체제에서 작동

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

다음 ~/.bundle/설정 파일을 편집하십시오 다음과 같이 보입니다.

--- 
BUNDLE_BUILD__THRIFT: "--with-cppflags=\"-D_FORTIFY_SOURCE=0 -Wno-shift-negative-value\"" 

감사합니다.