2013-10-23 291 views
7

我正在運行新安裝的OSX 10.9 Mavericks和XCode 5.0.1。當我試圖在我的項目中運行bundle安裝時,它無法安裝libv8 gem。下面是輸出:安裝libv8時出錯3.11.8.3

ERROR: Error installing libv8: 
     ERROR: Failed to build gem native extension. 

     /Users/user1/.rvm/rubies/ruby-1.9.3-p448/bin/ruby extconf.rb 
    creating Makefile 
    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++ 
    /Applications/Xcode.app/Contents/Developer/Toolchains/XcodeDefault.xctoolchain/usr/bin/libtool: file: /Users/user1/.rvm/gems/ruby-1.9.3-p448/gems/libv8-3.11.8.3/vendor/v8/out/x64.release/obj.target/preparser_lib/src/atomicops_internals_x86_gcc.o has no symbols 
    In file included from ../src/accessors.cc:28: 
    In file included from ../src/v8.h:60: 
    In file included from ../src/objects-inl.h:38: 
    In file included from ../src/elements.h:33: 
    In file included from ../src/heap.h:41: 
    ../src/store-buffer.h:229:9: error: private field 'heap_' is not used [-Werror,-Wunused-private-field] 
     Heap* heap_; 
      ^
    1 error generated. 
    make[1]: *** [/Users/user1/.rvm/gems/ruby-1.9.3-p448/gems/libv8-3.11.8.3/vendor/v8/out/x64.release/obj.target/v8_base/src/accessors.o] Error 1 
    make: *** [x64.release] Error 2 
    GYP_GENERATORS=make \ 
     build/gyp/gyp --generator-output="out" build/all.gyp \ 
         -Ibuild/standalone.gypi --depth=. \ 
         -Dv8_target_arch=x64 \ 
         -S.x64 -Dhost_arch=x64 
     CXX(target) /Users/user1/.rvm/gems/ruby-1.9.3-p448/gems/libv8-3.11.8.3/vendor/v8/out/x64.release/obj.target/preparser_lib/src/allocation.o 
     CXX(target) /Users/user1/.rvm/gems/ruby-1.9.3-p448/gems/libv8-3.11.8.3/vendor/v8/out/x64.release/obj.target/preparser_lib/src/atomicops_internals_x86_gcc.o 
     CXX(target) /Users/user1/.rvm/gems/ruby-1.9.3-p448/gems/libv8-3.11.8.3/vendor/v8/out/x64.release/obj.target/preparser_lib/src/bignum.o 
     CXX(target) /Users/user1/.rvm/gems/ruby-1.9.3-p448/gems/libv8-3.11.8.3/vendor/v8/out/x64.release/obj.target/preparser_lib/src/bignum-dtoa.o 
     CXX(target) /Users/user1/.rvm/gems/ruby-1.9.3-p448/gems/libv8-3.11.8.3/vendor/v8/out/x64.release/obj.target/preparser_lib/src/cached-powers.o 
     CXX(target) /Users/user1/.rvm/gems/ruby-1.9.3-p448/gems/libv8-3.11.8.3/vendor/v8/out/x64.release/obj.target/preparser_lib/src/conversions.o 
     CXX(target) /Users/user1/.rvm/gems/ruby-1.9.3-p448/gems/libv8-3.11.8.3/vendor/v8/out/x64.release/obj.target/preparser_lib/src/diy-fp.o 
     CXX(target) /Users/user1/.rvm/gems/ruby-1.9.3-p448/gems/libv8-3.11.8.3/vendor/v8/out/x64.release/obj.target/preparser_lib/src/dtoa.o 
     CXX(target) /Users/user1/.rvm/gems/ruby-1.9.3-p448/gems/libv8-3.11.8.3/vendor/v8/out/x64.release/obj.target/preparser_lib/src/fast-dtoa.o 
     CXX(target) /Users/user1/.rvm/gems/ruby-1.9.3-p448/gems/libv8-3.11.8.3/vendor/v8/out/x64.release/obj.target/preparser_lib/src/fixed-dtoa.o 
     CXX(target) /Users/user1/.rvm/gems/ruby-1.9.3-p448/gems/libv8-3.11.8.3/vendor/v8/out/x64.release/obj.target/preparser_lib/src/once.o 
     CXX(target) /Users/user1/.rvm/gems/ruby-1.9.3-p448/gems/libv8-3.11.8.3/vendor/v8/out/x64.release/obj.target/preparser_lib/src/preparse-data.o 
     CXX(target) /Users/user1/.rvm/gems/ruby-1.9.3-p448/gems/libv8-3.11.8.3/vendor/v8/out/x64.release/obj.target/preparser_lib/src/preparser.o 
     CXX(target) /Users/user1/.rvm/gems/ruby-1.9.3-p448/gems/libv8-3.11.8.3/vendor/v8/out/x64.release/obj.target/preparser_lib/src/preparser-api.o 
     CXX(target) /Users/user1/.rvm/gems/ruby-1.9.3-p448/gems/libv8-3.11.8.3/vendor/v8/out/x64.release/obj.target/preparser_lib/src/scanner.o 
     CXX(target) /Users/user1/.rvm/gems/ruby-1.9.3-p448/gems/libv8-3.11.8.3/vendor/v8/out/x64.release/obj.target/preparser_lib/src/strtod.o 
     CXX(target) /Users/user1/.rvm/gems/ruby-1.9.3-p448/gems/libv8-3.11.8.3/vendor/v8/out/x64.release/obj.target/preparser_lib/src/token.o 
     CXX(target) /Users/user1/.rvm/gems/ruby-1.9.3-p448/gems/libv8-3.11.8.3/vendor/v8/out/x64.release/obj.target/preparser_lib/src/unicode.o 
     CXX(target) /Users/user1/.rvm/gems/ruby-1.9.3-p448/gems/libv8-3.11.8.3/vendor/v8/out/x64.release/obj.target/preparser_lib/src/utils.o 
     LIBTOOL-STATIC /Users/user1/.rvm/gems/ruby-1.9.3-p448/gems/libv8-3.11.8.3/vendor/v8/out/x64.release/libpreparser_lib.a 
     CXX(target) /Users/user1/.rvm/gems/ruby-1.9.3-p448/gems/libv8-3.11.8.3/vendor/v8/out/x64.release/obj.target/preparser/preparser/preparser-process.o 
     LINK(target) /Users/user1/.rvm/gems/ruby-1.9.3-p448/gems/libv8-3.11.8.3/vendor/v8/out/x64.release/preparser 
     CXX(target) /Users/user1/.rvm/gems/ruby-1.9.3-p448/gems/libv8-3.11.8.3/vendor/v8/out/x64.release/obj.target/v8_base/src/accessors.o 


    Gem files will remain installed in /Users/user1/.rvm/gems/ruby-1.9.3-p448/gems/libv8-3.11.8.3 for inspection. 
    Results logged to /Users/user1/.rvm/gems/ruby-1.9.3-p448/gems/libv8-3.11.8.3/ext/libv8/gem_make.out 

也做得

gcc -v 

當我得到

Configured with: --prefix=/Applications/Xcode.app/Contents/Developer/usr --with-gxx-include-dir=/usr/include/c++/4.2.1 
Apple LLVM version 5.0 (clang-500.2.79) (based on LLVM 3.3svn) 
Target: x86_64-apple-darwin13.0.0 
Thread model: posix 

我試圖通過自制安裝GCC,但這並不能幫助。還有其他可行的解決方案

回答

0

好的,安裝舊版本的Xcode(4.6.3)並將命令行工具版本更改爲Xcode首選項中的舊版本解決了問題。

0

在您的應用程序文件夾中安裝的XCode 4.6.3,然後運行

sudo xcode-select --switch /Applications/Xcode4.6.3.app/Contents/Developer 

一旦你完成安裝libv8你可以通過做

sudo xcode-select --switch /Applications/Xcode.app/Contents/Developer 
+0

不可能在Mavaricks上設置舊的Xcode – Anatoly

6

切換到舊版本的回覆Xcode不適合我。相反,我用github的最後一個libv8修復程序:https://github.com/cowboyd/libv8/issues/107

它完美地工作。

+1

按照註釋中的步驟在本地進行編譯/安裝,它對我很有用。 – RonanOD

+0

這是經過多次SO爬行後才終於實現的。對於其他已經出現OSX10.9問題的用戶,我還手動安裝了Mavericks XCODE 5.1命令行工具 - 它曾經是這樣的,您可以從xcode中安裝它,但現在我相信您需要轉到「適用於蘋果的下載開發人員「網站https://developer.apple.com/downloads/index.action?name=for%20Xcode%20-#和使用你的蘋果ID(無需開發賬戶)下載10.9選項卡下的命令行工具。 – xxjjnn

+0

我在編譯git源代碼時遇到了同樣的錯誤。 –