2015-01-02 2 views
4

여기에 나와있는 단계를 따라 "gem install therubyracer -v '0.10.2'" on osx mavericks not installing을 실행하면 rbyracer -v 0.10.2와 0.12.0을 설치하면 잘되지만 0.11.4는 얻을 수 없었습니다.gem install theruraracer -v 0.11.4가 OS X 10.10에서 작동하지 않습니다.

gem install therubyracer -v 0.11.4

결과 :

Building native extensions. This could take a while... 
ERROR: Error installing therubyracer: 
    ERROR: Failed to build gem native extension. 

    /Users/thooper/.rbenv/versions/2.1.2/bin/ruby -r ./siteconf20150102-7132-9ct9a4.rb extconf.rb 
creating Makefile 
Compiling v8 for x64 
Using python 2.7.9 
Configured with: --prefix=/Applications/Xcode.app/Contents/Developer/usr --with-gxx-include-dir=/usr/include/c++/4.2.1 
Unable to find a compiler officially supported by v8. 
It is recommended to use GCC v4.4 or higher 
Using compiler: g++ 
Configured with: --prefix=/Applications/Xcode.app/Contents/Developer/usr --with-gxx-include-dir=/usr/include/c++/4.2.1 
Unable to find a compiler officially supported by v8. 
It is recommended to use GCC v4.4 or higher 
../src/cached-powers.cc:136:18: error: unused variable 'kCachedPowersLength' [-Werror,-Wunused-const-variable] 
static const int kCachedPowersLength = ARRAY_SIZE(kCachedPowers); 
       ^
1 error generated. 
make[1]: *** [/Users/thooper/.rbenv/versions/2.1.2/lib/ruby/gems/2.1.0/gems/libv8-3.11.8.17/vendor/v8/out/x64.release/obj.target/preparser_lib/src/cached-powers.o] Error 1 
make: *** [x64.release] Error 2 
/Users/thooper/.rbenv/versions/2.1.2/lib/ruby/gems/2.1.0/gems/libv8-3.11.8.17/ext/libv8/location.rb:36:in `block in verify_installation!': libv8 did not install properly, expected binary v8 archive '/Users/thooper/.rbenv/versions/2.1.2/lib/ruby/gems/2.1.0/gems/libv8-3.11.8.17/vendor/v8/out/x64.release/obj.target/tools/gyp/libv8_base.a'to exist, but it was not found (Libv8::Location::Vendor::ArchiveNotFound) 
    from /Users/thooper/.rbenv/versions/2.1.2/lib/ruby/gems/2.1.0/gems/libv8-3.11.8.17/ext/libv8/location.rb:35:in `each' 
    from /Users/thooper/.rbenv/versions/2.1.2/lib/ruby/gems/2.1.0/gems/libv8-3.11.8.17/ext/libv8/location.rb:35:in `verify_installation!' 
    from /Users/thooper/.rbenv/versions/2.1.2/lib/ruby/gems/2.1.0/gems/libv8-3.11.8.17/ext/libv8/location.rb:26:in `install!' 
    from extconf.rb:7:in `<main>' 
GYP_GENERATORS=make \ 
    build/gyp/gyp --generator-output="out" build/all.gyp \ 
        -Ibuild/standalone.gypi --depth=. \ 
        -Dv8_target_arch=x64 \ 
        -S.x64 -Dv8_can_use_vfp_instructions=true 
    CXX(target) /Users/thooper/.rbenv/versions/2.1.2/lib/ruby/gems/2.1.0/gems/libv8-3.11.8.17/vendor/v8/out/x64.release/obj.target/preparser_lib/src/allocation.o 
    CXX(target) /Users/thooper/.rbenv/versions/2.1.2/lib/ruby/gems/2.1.0/gems/libv8-3.11.8.17/vendor/v8/out/x64.release/obj.target/preparser_lib/src/atomicops_internals_x86_gcc.o 
    CXX(target) /Users/thooper/.rbenv/versions/2.1.2/lib/ruby/gems/2.1.0/gems/libv8-3.11.8.17/vendor/v8/out/x64.release/obj.target/preparser_lib/src/bignum.o 
    CXX(target) /Users/thooper/.rbenv/versions/2.1.2/lib/ruby/gems/2.1.0/gems/libv8-3.11.8.17/vendor/v8/out/x64.release/obj.target/preparser_lib/src/bignum-dtoa.o 
    CXX(target) /Users/thooper/.rbenv/versions/2.1.2/lib/ruby/gems/2.1.0/gems/libv8-3.11.8.17/vendor/v8/out/x64.release/obj.target/preparser_lib/src/cached-powers.o 

extconf failed, exit code 1 

Gem files will remain installed in /Users/thooper/.rbenv/versions/2.1.2/lib/ruby/gems/2.1.0/gems/libv8-3.11.8.17 for inspection. 
Results logged to /Users/thooper/.rbenv/versions/2.1.2/lib/ruby/gems/2.1.0/extensions/x86_64-darwin-14/2.1.0-static/libv8-3.11.8.17/gem_make.out 

답변

3

마침내 theraracer 0.11.4를 설치하고 Xcode 6.1.1, 6.2 베타 또는 6.3 베타 (모두 3 개를 테스트했습니다) 및 Xcode 4.6.3 (사용 가능 : https://developer.apple.com/downloads/index.action)을 사용하여 다음을 실행합니다.

# rename your current version of Xcode to make it distinguishable 
sudo mv /Applications/Xcode.app /Applications/$(xcodebuild -version | head -1 | sed -e 's/ //').app 

# Download and install Xcode 4.6.3 and run: 
sudo mv /Applications/Xcode.app /Applications/Xcode4.6.3.app 

# Switch to your 4.6.3 version of Xcode 
sudo xcode-select --switch /Applications/Xcode4.6.3.app 

# Install the version of libv8 that's tied to your version of TRR: 
gem install libv8 -v '3.11.8.17' 

# Switch back to you original version of Xcode 
sudo xcode-select --switch /Applications/Xcode6.x.app 

# Install TRR 
gem install therubyracer -v '0.11.4' 
+0

요세미티 문제가 해결되었습니다. –

0

이 줄이 오류 메시지에 몇 번 나타납니다

It is recommended to use GCC v4.4 or higher 

당신이 수행 한 단계에 대한 링크가있는 것으로 추정를 brew install apple-gcc42를 실행 말한다 GCC 4.2를 설치합니다. 4.2는 4.4 미만입니다. 어떻게 든 메이크 파일을 편집 할 수 있습니다 (또는 extconf.rb) 그 또한 작동 할 수 있습니다, 그 플래그를 제거한다면

../src/cached-powers.cc:136:18: error: unused variable 'kCachedPowersLength' [-Werror,-Wunused-const-variable] 

:


C 소스가 생성하는 것을 특정 오류 것 같다 . 그러나 나는 cflags를 수정하는 것이 약간 해킹 된 것 같기 때문에 호환성있는 컴파일러를 설치하는 것이 좋습니다.

2

이것은 정확히 내가 겪고있는 문제이며, 홈브류 버전을 사용하여 해결했습니다.

문제

보석 libv8을 설치하는 데 문제가있었습니다. 이 문제를 해결하기 위해 brew를 통해 시스템에 v8을 설치 한 다음 --with-system-v8 옵션을 사용했습니다.

$ brew install v8 
$ gem install libv8 -v '3.11.8.13' -- --with-system-v8 
$ gem install therubyracer -v '0.11.4' 

gem libv8이 문제없이 설치되었지만 마지막 줄에 원래 질문의 오류가 발생했습니다. 나는 그 다음 시도했다,

$ gem install therubyracer -v '0.11.4' -- --with-system-v8 --with-v8-dir=/usr/local/Cellar/v8/3.30.33.16 

brew에서 제공하는 v8을 가리킨다. 이 경우 오류가 변경되었으며 지금은과 호환되는 v8 버전을 제공하지 않는다고 말했습니다. 오류 메시지를 검색하는 사람들을 위해

: 나는 V8의 이전 버전을 설치하기로 결정

Building native extensions with: '--with-v8-dir=/usr/local/Cellar/v8/3.30.33.16/' 
This could take a while... 
ERROR: Error installing therubyracer: 
    ERROR: Failed to build gem native extension. 

    /Users/zeigfreid/.rvm/rubies/ruby-1.9.3-p194/bin/ruby extconf.rb --with-v8-dir=/usr/local/Cellar/v8/3.30.33.16/ 
checking for main() in -lpthread... yes 
checking for main() in -lobjc... yes 
checking for v8.h... no 
*** extconf.rb failed *** 
Could not create Makefile due to some reason, probably lack of 
necessary libraries and/or headers. Check the mkmf.log file for more 
details. You may need configuration options. 

Provided configuration options: 
    --with-opt-dir 
    --with-opt-include 
    --without-opt-include=${opt-dir}/include 
    --with-opt-lib 
    --without-opt-lib=${opt-dir}/lib 
    --with-make-prog 
    --without-make-prog 
    --srcdir=. 
    --curdir 
    --ruby=/Users/zeigfreid/.rvm/rubies/ruby-1.9.3-p194/bin/ruby 
    --with-pthreadlib 
    --without-pthreadlib 
    --with-objclib 
    --without-objclib 
    --enable-debug 
    --disable-debug 
    --with-v8-dir 
    --with-v8-include 
    --without-v8-include=${v8-dir}/include 
    --with-v8-lib 
    --without-v8-lib=${v8-dir}/lib 
/Users/zeigfreid/.rvm/gems/[email protected]_rails_3.2.11/gems/libv8-3.11.8.13/ext/libv8/location.rb:50:in `configure': You have chosen to use the version of V8 found on your system (Libv8::Location::System::NotFoundError) 
and *not* the one that is bundle with the libv8 rubygem. However, 
it could not be located. please make sure you have a version of 
v8 that is compatible with 3.11.8.13 installed. You may 
need to special --with-v8-dir options if it is in a non-standard 
location 

thanks, 
The Mgmt 

    from /Users/zeigfreid/.rvm/gems/ruby-1.9.3-p19[email protected]_rails_3.2.11/gems/libv8-3.11.8.13/lib/libv8.rb:7:in `configure_makefile' 
    from extconf.rb:32:in `<main>' 

extconf failed, exit code 1 

Gem files will remain installed in /Users/zeigfreid/.rvm/gems/[email protected]_rails_3.2.11/gems/therubyracer-0.11.4 for inspection. 
Results logged to /Users/zeigfreid/.rvm/gems/[email protected]_rails_3.2.11/extensions/x86_64-darwin-13/1.9.1/therubyracer-0.11.4/gem_make.out 

솔루션. 브루 잉을 다시 사용하여

$ brew search v8 
homebrew/versions/v8-315 v8 
$ brew install v8-315 
$ brew info v8-315 
$ gem install therubyracer -v '0.11.4' -- --with-system-v8 --with-v8-dir=/usr/local/Cellar/v8-315/3.15.11 

이 방법이 효과적입니다. 설치가 끝난 v8 버전은 ~ 3.15이지만 호환이 가능합니다. 3.11.8

실제 해결책은 모든 것을 최신 버전으로 업데이트하는 것입니다. 오래된 보석을 오래 사용하는 것을지지하지 않습니다. 시스템이 손상된 경우에도 깨끗하고 최신 상태로 유지하십시오!

관련 문제