修复小牛的therubyracer / libv8(0.12.1)安装 [英] Fix therubyracer/libv8 (0.12.1) installation on Mavericks

查看:446
本文介绍了修复小牛的therubyracer / libv8(0.12.1)安装的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

好的,我在这个系列的最后。有几个类似的问题,但他们都指的是0.10版的therubyracer,他们大多认为问题可以通过升级到0.12来解决。



我有类似的问题,但是当我使用0.12。



类似的问题





我在使用'standard'时遇到问题(xcode? )gcc,以及来自自制软件的apple-gcc42和gcc。我试过 --with-system-v8 - without-system-v8 ,再次,没有骰子。



以下是一些日志:

从头开始...



  $ cd〜/ Documents / code / website 
$ rvm gemset empty
$ ruby​​ -v
ruby​​ 1.9.3p448(2013 -06-27修订版41675)[x86_64-darwin10.8.0]
$ grep ruby​​racer Gemfile
gem'therubyracer','〜> 0.12.0'
$ brew list | grep v8
$ cat〜/ .bundle / config
$ cat .bundle / config
BUNDLE_BIN:bin
$ $ CXX
$ $ CPP
$ $ CC
$其中gcc
/ usr / bin / gcc
$其中g ++
/ usr / bin / g ++
$ g ++ -v
配置有:--prefix = / Applications / Xcode.app / Contents / Developer / usr --with-
gxx-include-dir = / usr / include / c ++ / 4.2.1
Apple LLVM version 5.1 clang-503.0.38)(基于LLVM 3.4svn)
目标:x86_64-apple-darwin13.0.0
线程模型:posix

安装libv8(3.16.14.3)

$ b Gem :: Installer :: ExtensionBuildError:错误:无法构建gem本机扩展。

/Users/chris/.rvm/rubies/ruby-1.9.3-p448/bin/ruby extconf.rb
创建Makefile
为x64编译v8
使用python 2.7.5
配置:--prefix = / Applications / Xcode.app /目录/ Developer / usr --with-gxx-include-dir = / usr / include / c ++ / 4.2.1
无法找到v8官方支持的编译器。
建议使用GCC v4.4或更高版本
使用编译器:g ++
配置:--prefix = / Applications / Xcode.app / Contents / Developer / usr --with- gxx-include-dir = / usr / include / c ++ / 4.2.1
无法找到v8官方支持的编译器。
建议使用GCC v4.4或更高版本
../src/cached-powers.cc:136:18:error:未使用变量'kCachedPowersLength'[-Werror,-Wunused-const-变量]
static const int kCachedPowersLength = ARRAY_SIZE(kCachedPowers);
^
1产生的错误。
make [1]:*** [/Users/chris/.rvm/gems/ruby-1.9.3-p448@website/gems/libv8-3.16.14.3/vendor/v8/out/x64.release /obj.target/preparser_lib/src/cached-powers.o]错误1
make:*** [x64.release]错误2
/Users/chris/.rvm/gems/ruby-1.9 .3-p448 @ website / gems / libv8-3.16.14.3 / ext / libv8 / location.rb:36:在`block in verify_installation!'中:libv8没有正确安装,预期二进制v8 archive'/ Users / chris /。 rvm/gems/ruby-1.9.3-p448@website/gems/libv8-3.16.14.3/vendor/v8/out/x64.release/obj.target/tools/gyp/libv8_base.a'to exists,但它是找不到(Libv8 :: Location :: Vendor :: ArchiveNotFound)
from /Users/chris/.rvm/gems/ruby-1.9.3-p448@website/gems/libv8-3.16.14.3/ext/libv8 /location.rb:35:in from /Users/chris/.rvm/gems/ruby-1.9.3-p448@website/gems/libv8-3.16.14.3/ext/libv8/location中的每个
。 rb:35:在`verify_installation!'
from /Users/chris/.rvm/gems/ruby-1.9.3-p448@website/gems/libv8-3.16.14.3/ext/libv8/location.rb: 26:在`安装!'
从分机conf.rb:7:在`< main>'
GYP_GENERATORS = make \
build / gyp / gyp --generator-output =outbuild / all.gyp \
-Ibuild / standalone.gypi --depth =。 \
-Dv8_target_arch = x64 \
-S.x64 -Dv8_enable_backtrace = 1 -Dv8_can_use_vfp2_instructions = true -Darm_fpu = vfpv2 -Dv8_can_use_vfp3_instructions = true -Darm_fpu = vfpv3
CXX(target)/ Users /chris/.rvm/gems/ruby-1.9.3-p448@website/gems/libv8-3.16.14.3/vendor/v8/out/x64.release/obj.target/preparser_lib/src/allocation.o
CXX(目标)/Users/chris/.rvm/gems/ruby-1.9.3-p448@website/gems/libv8-3.16.14.3/vendor/v8/out/x64.release/obj.target/preparser_lib/src /atomicops_internals_x86_gcc.o
CXX(目标)/Users/chris/.rvm/gems/ruby-1.9.3-p448@website/gems/libv8-3.16.14.3/vendor/v8/out/x64.release/ obj.target/preparser_lib/src/bignum.o
CXX(目标)/Users/chris/.rvm/gems/ruby-1.9.3-p448@website/gems/libv8-3.16.14.3/vendor/v8 /out/x64.release/obj.target/preparser_lib/src/bignum-dtoa.o
CXX(目标)/Users/chris/.rvm/gems/ruby-1.9.3-p448@website/gems/ libv8-3.16.14.3 /供应商/ V8 /缩小/ x64.release / obj.target / preparser_lib / SRC / cached- powers.o


Gem文件将保留安装在/Users/chris/.rvm/gems/ruby-1.9.3-p448@website/gems/libv8-3.16.14.3以供检查。
记录到/Users/chris/.rvm/gems/ruby-1.9.3-p448@website/gems/libv8-3.16.14.3/ext/libv8/gem_make.out

的结果安装libv8(3.16.14.3)时发生错误,并且Bundler无法继续。



坏时间



错误讯息建议建议使用gcc 4.4+。

  $ export CXX = / usr / local / Cellar / gcc48 / 4.8.2 / bin / g ++  - 4.8 
$ export CPP = / usr / local / Cellar / gcc48 / 4.8.2 / bin / cpp-4.8
$ export CC = / usr / local / Cellar / gcc48 / 4.8.2 / bin / gcc-4.8
$ which $ CXX
/usr/local/Cellar/gcc48/4.8.2/bin/g++-4.8
$ which $ CPP
/ usr / local / Cellar / gcc48 / 4.8.2 / bin / cpp-4.8
$ which $ CC
/usr/local/Cellar/gcc48/4.8.2/bin/gcc-4.8
$ bundle install
...
安装libv8(3.16.14.3)
Gem :: Installer :: ExtensionBuildError:错误:无法构建gem本机扩展。

/Users/chris/.rvm/rubies/ruby-1.9.3-p448/bin/ruby extconf.rb
创建Makefile
为x64编译v8
使用python 2.7.5
使用编译器:/usr/local/Cellar/gcc48/4.8.2/bin/g++-4.8
g ++ - 4.8:error:无法识别的命令行选项'-Wnewline -eof'
make [1]:*** [/Users/chris/.rvm/gems/ruby-1.9.3-p448@website/gems/libv8-3.16.14.3/vendor/v8/out/x64.release /obj.target/preparser_lib/src/allocation.o]错误1
make:*** [x64.release]错误2
/Users/chris/.rvm/gems/ruby-1.9.3 -p448@website/gems/libv8-3.16.14.3/ext/libv8/location.rb:36:在`block in verify_installation!'中:libv8没有正确安装,期望二进制v8 archive'/Users/chris/.rvm/ gems/ruby-1.9.3-p448@website/gems/libv8-3.16.14.3/vendor/v8/out/x64.release/obj.target/tools/gyp/libv8_base.a'存在,但未找到(Libv8 :: Location :: Vendor :: ArchiveNotFound)
from /Users/chris/.rvm/gems/ruby-1.9.3-p448@website/gems/libv8-3.16.14.3/ext/libv8/location .RB:35 :来自/Users/chris/.rvm/gems/ruby-1.9.3-p448@website/gems/libv8-3.16.14.3/ext/libv8/location.rb:35:in的`each'
' 'verify_installation!'
from /Users/chris/.rvm/gems/ruby-1.9.3-p448@website/gems/libv8-3.16.14.3/ext/libv8/location.rb:26:in`install! '
from extconf.rb:7:'< main>'
GYP_GENERATORS = make \
build / gyp / gyp --generator-output =outbuild / all。 gyp \
-Ibuild / standalone.gypi --depth =。 \
-Dv8_target_arch = x64 \
-S.x64 -Dv8_enable_backtrace = 1 -Dv8_can_use_vfp2_instructions = true -Darm_fpu = vfpv2 -Dv8_can_use_vfp3_instructions = true -Darm_fpu = vfpv3
CXX(target)/ Users /chris/.rvm/gems/ruby-1.9.3-p448@website/gems/libv8-3.16.14.3/vendor/v8/out/x64.release/obj.target/preparser_lib/src/allocation.o


Gem文件将保留安装在/Users/chris/.rvm/gems/ruby-1.9.3-p448@website/gems/libv8-3.16.14.3进行检查。
记录到/Users/chris/.rvm/gems/ruby-1.9.3-p448@website/gems/libv8-3.16.14.3/ext/libv8/gem_make.out

的结果安装libv8(3.16.14.3)时发生错误,并且Bundler无法继续。
确保在捆绑之前`gem install libv8 -v'3.16.14.3'`成功。



更糟糕的时间!



好的。因此,为了解决与therubyracer 0.10有关的问题,一些人推荐brew安装v8,然后告诉rubygems使用系统v8。让我们看看会发生什么!

  $ brew install v8 
==>正在下载https://github.com/v8/v8/archive/3.21.17.tar.gz
已经下载:/Library/Caches/Homebrew/v8-3.21.17.tar.gz
= =>检出http://gyp.googlecode.com/svn/trunk
==>使本机-j4库=共享快照=在控制台= readline i18nsupport =关

OK, I’m at the end of my tether with this. There are a few similar questions but they all refer to therubyracer 0.10, and they mostly conclude that the problem can be fixed by upgrading to 0.12.

I’m having similar problems, but when I use 0.12.

Similar questions

I’m having problems using ‘standard’ (xcode?) gcc, and both apple-gcc42 and gcc from homebrew. I’ve tried both --with-system-v8 and --without-system-v8, and again, no dice.

Here’s some logs:

Starting from scratch…

 $ cd ~/Documents/code/website
 $ rvm gemset empty
 $ ruby -v
 ruby 1.9.3p448 (2013-06-27 revision 41675) [x86_64-darwin10.8.0]
 $ grep rubyracer Gemfile
 gem 'therubyracer', '~> 0.12.0'
 $ brew list | grep v8
 $ cat ~/.bundle/config 
 $ cat .bundle/config 
 BUNDLE_BIN: bin
 $ $CXX
 $ $CPP
 $ $CC
 $ which gcc
 /usr/bin/gcc
 $ which g++
 /usr/bin/g++
 $ g++ -v
 Configured with: --prefix=/Applications/Xcode.app/Contents/Developer/usr --with- 
 gxx-include-dir=/usr/include/c++/4.2.1
 Apple LLVM version 5.1 (clang-503.0.38) (based on LLVM 3.4svn)
 Target: x86_64-apple-darwin13.0.0
 Thread model: posix

Try a bundle install

Installing libv8 (3.16.14.3) 
Gem::Installer::ExtensionBuildError: ERROR: Failed to build gem native extension.

    /Users/chris/.rvm/rubies/ruby-1.9.3-p448/bin/ruby extconf.rb 
creating Makefile
Compiling v8 for x64
Using python 2.7.5
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/chris/.rvm/gems/ruby-1.9.3-p448@website/gems/libv8-3.16.14.3/vendor/v8/out/x64.release/obj.target/preparser_lib/src/cached-powers.o] Error 1
make: *** [x64.release] Error 2
/Users/chris/.rvm/gems/ruby-1.9.3-p448@website/gems/libv8-3.16.14.3/ext/libv8/location.rb:36:in `block in verify_installation!': libv8 did not install properly, expected binary v8 archive '/Users/chris/.rvm/gems/ruby-1.9.3-p448@website/gems/libv8-3.16.14.3/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/chris/.rvm/gems/ruby-1.9.3-p448@website/gems/libv8-3.16.14.3/ext/libv8/location.rb:35:in `each'
    from /Users/chris/.rvm/gems/ruby-1.9.3-p448@website/gems/libv8-3.16.14.3/ext/libv8/location.rb:35:in `verify_installation!'
    from /Users/chris/.rvm/gems/ruby-1.9.3-p448@website/gems/libv8-3.16.14.3/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_enable_backtrace=1 -Dv8_can_use_vfp2_instructions=true -Darm_fpu=vfpv2 -Dv8_can_use_vfp3_instructions=true -Darm_fpu=vfpv3
  CXX(target) /Users/chris/.rvm/gems/ruby-1.9.3-p448@website/gems/libv8-3.16.14.3/vendor/v8/out/x64.release/obj.target/preparser_lib/src/allocation.o
  CXX(target) /Users/chris/.rvm/gems/ruby-1.9.3-p448@website/gems/libv8-3.16.14.3/vendor/v8/out/x64.release/obj.target/preparser_lib/src/atomicops_internals_x86_gcc.o
  CXX(target) /Users/chris/.rvm/gems/ruby-1.9.3-p448@website/gems/libv8-3.16.14.3/vendor/v8/out/x64.release/obj.target/preparser_lib/src/bignum.o
  CXX(target) /Users/chris/.rvm/gems/ruby-1.9.3-p448@website/gems/libv8-3.16.14.3/vendor/v8/out/x64.release/obj.target/preparser_lib/src/bignum-dtoa.o
  CXX(target) /Users/chris/.rvm/gems/ruby-1.9.3-p448@website/gems/libv8-3.16.14.3/vendor/v8/out/x64.release/obj.target/preparser_lib/src/cached-powers.o


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

An error occurred while installing libv8 (3.16.14.3), and Bundler cannot continue.

Bad times.

Error message advises that gcc 4.4+ is recommended. We can do that.

$ export CXX=/usr/local/Cellar/gcc48/4.8.2/bin/g++-4.8 
$ export CPP=/usr/local/Cellar/gcc48/4.8.2/bin/cpp-4.8 
$ export CC=/usr/local/Cellar/gcc48/4.8.2/bin/gcc-4.8 
$ which $CXX
/usr/local/Cellar/gcc48/4.8.2/bin/g++-4.8
$ which $CPP
/usr/local/Cellar/gcc48/4.8.2/bin/cpp-4.8
$ which $CC
/usr/local/Cellar/gcc48/4.8.2/bin/gcc-4.8
$ bundle install
…
Installing libv8 (3.16.14.3) 
Gem::Installer::ExtensionBuildError: ERROR: Failed to build gem native extension.

        /Users/chris/.rvm/rubies/ruby-1.9.3-p448/bin/ruby extconf.rb 
creating Makefile
Compiling v8 for x64
Using python 2.7.5
Using compiler: /usr/local/Cellar/gcc48/4.8.2/bin/g++-4.8
g++-4.8: error: unrecognized command line option '-Wnewline-eof'
make[1]: *** [/Users/chris/.rvm/gems/ruby-1.9.3-p448@website/gems/libv8-3.16.14.3/vendor/v8/out/x64.release/obj.target/preparser_lib/src/allocation.o] Error 1
make: *** [x64.release] Error 2
/Users/chris/.rvm/gems/ruby-1.9.3-p448@website/gems/libv8-3.16.14.3/ext/libv8/location.rb:36:in `block in verify_installation!': libv8 did not install properly, expected binary v8 archive '/Users/chris/.rvm/gems/ruby-1.9.3-p448@website/gems/libv8-3.16.14.3/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/chris/.rvm/gems/ruby-1.9.3-p448@website/gems/libv8-3.16.14.3/ext/libv8/location.rb:35:in `each'
    from /Users/chris/.rvm/gems/ruby-1.9.3-p448@website/gems/libv8-3.16.14.3/ext/libv8/location.rb:35:in `verify_installation!'
    from /Users/chris/.rvm/gems/ruby-1.9.3-p448@website/gems/libv8-3.16.14.3/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_enable_backtrace=1 -Dv8_can_use_vfp2_instructions=true -Darm_fpu=vfpv2 -Dv8_can_use_vfp3_instructions=true -Darm_fpu=vfpv3
  CXX(target) /Users/chris/.rvm/gems/ruby-1.9.3-p448@website/gems/libv8-3.16.14.3/vendor/v8/out/x64.release/obj.target/preparser_lib/src/allocation.o


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

An error occurred while installing libv8 (3.16.14.3), and Bundler cannot continue.
Make sure that `gem install libv8 -v '3.16.14.3'` succeeds before bundling.

Worse times!

OK. So to fix the issues with therubyracer 0.10, some people recommend brew installing v8, then telling rubygems to use system v8. Let’s see what happens!

$ brew install v8
==> Downloading https://github.com/v8/v8/archive/3.21.17.tar.gz
Already downloaded: /Library/Caches/Homebrew/v8-3.21.17.tar.gz
==> Checking out http://gyp.googlecode.com/svn/trunk
==> make native -j4 library=shared snapshot=on console=readline i18nsupport=off

                        

这篇关于修复小牛的therubyracer / libv8(0.12.1)安装的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

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