本文介绍了安装libv8 3.11.8.3时出错的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

我正在运行新安装的OSX 10.9 Mavericks和XCode 5.0.1。当我试图在我的项目中运行bundle安装时,它无法安装libv8 gem。以下是输出:

 错误:安装libv8时出错:
错误:无法构建gem原生扩展。

/Users/user1/.rvm/rubies/ruby-1.9.3-p448/bin/ruby extconf.rb
创建Makefile
配置:--prefix = / Applications / Xcode.app / Contents / Developer / usr --with-gxx-include-dir = / usr / include / c ++ / 4.2.1
无法找到v8官方支持的编译器。
建议使用GCC v4.4或更高版本
使用编译器: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没有符号
在../src/accessors.cc:28中包含的文件中:
在../src/v8.h:60中包含的文件中:
在包含的文件中.. .. /src/objects-inl.h:38:
在../src/elements.h:33包含的文件中:
从../src/heap.h:41包含的文件中:
../src/store-buffer.h:229:9:错误:未使用专用字段'heap_'[-Werror,-Wunused-private-field]
Heap * heap_;
^
1产生的错误。
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]错误1
make:*** [x64.release]错误2
GYP_GENERATORS = make \
build / gyp / gyp --generator -output =outbuild / all.gyp \
-Ibuild / standalone.gypi --depth =。 \
-Dv8_target_arch = x64 \
-S.x64 -Dhost_arch = x64
CXX(目标)/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(目标)/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(目标)/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(目标)/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(目标)/Users/user1/.rvm/gems/ruby-1.9.3-p448/gems/libv8-3.11.8.3/vendor/v8/out/x64.release/obj.target / PR eparser_lib / src / conversions.o
CXX(目标)/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(目标)/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(目标)/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(目标)/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(目标)/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 (目标)/Users/user1/.rvm/gems/ruby-1.9.3-p448/gems/libv8-3.11.8.3/ve ndor / v8 / out / x64.release / obj.target / preparser_lib / src / preparser.o
CXX(目标)/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(目标)/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(目标)/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(目标)/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/rub y-1.9.3-p448 / gems / libv8-3.11.8.3 / vendor / v8 / out / x64.release / libpreparser_lib.a
CXX(目标)/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(目标)/ 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文件将继续安装在/Users/user1/.rvm/gems/ruby-1.9.3-p448/gems/libv8-3.11.8.3中进行检查。
结果记录到/Users/user1/.rvm/gems/ruby-1.9.3-p448/gems/libv8-3.11.8.3/ext/libv8/gem_make.out

同样在做

  gcc -v 

我得到

 配置为:--prefix = / Applications / Xcode.app /目录/ Developer / usr --with-gxx-include-dir = / usr / include / c ++ / 4.2.1 
Apple LLVM 5.0版(clang-500.2.79)(基于LLVM 3.3svn)
目标:x86_64-apple-darwin13.0.0
线程模型:posix

我尝试通过自制程序安装gcc,但这没有帮助。其他可能的解决方案是什么?

解决方案

切换到旧版本的Xcode并不适合我。相反,我使用了github的最新libv8修复程序:



完美无瑕。


I'm running fresh install of OSX 10.9 Mavericks and XCode 5.0.1. When i'm trying to run bundle install in my project it fails on installing libv8 gem. Here's the output:

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

Also when doing

gcc -v

i'm getting

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

I've tried installing gcc via homebrew, but this doesn't help. What are other possible solutions?

解决方案

Switch to an older version of Xcode didn't work for me. Instead I used last libv8 fixes from github : https://github.com/cowboyd/libv8/issues/107

It works perfectly.

这篇关于安装libv8 3.11.8.3时出错的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持!

07-25 18:49