我升级了我的ruby版本,当我安装ruby racer时,我收到以下错误。按如下方式安装libv8 gem install libv8 - --with-v8-lib
ERROR: Error installing therubyracer:
ERROR: Failed to build gem native extension.
/Users/ViswaMani/.rvm/rubies/ruby-2.1.1/bin/ruby extconf.rb
creating Makefile
Compiling v8 for x64
Using python 2.7.6
Using compiler: /usr/bin/c++ (clang version 6.1.0)
/Applications/Xcode.app/Contents/Developer/Toolchains/XcodeDefault.xctoolchain/usr/bin/libtool: file: /Users/ViswaMani/.rvm/gems/ruby-2.1.1@futura/gems/libv8-3.16.14.11/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:35:
In file included from ../src/incremental-marking.h:33:
In file included from ../src/mark-compact.h:32:
../src/spaces.h:896:26: error: 'this' pointer cannot be null in well-defined C++ code; comparison may be assumed to always evaluate to true [-Werror,-Wtautological-undefined-compare]
bool exists() { return this != NULL && code_range_ != NULL; }
^~~~ ~~~~
../src/spaces.h:898:9: error: 'this' pointer cannot be null in well-defined C++ code; comparison may be assumed to always evaluate to false [-Werror,-Wtautological-undefined-compare]
if (this == NULL || code_range_ == NULL) return false;
^~~~ ~~~~
2 errors generated.
make[1]: *** [/Users/ViswaMani/.rvm/gems/ruby-2.1.1@futura/gems/libv8-3.16.14.11/vendor/v8/out/x64.release/obj.target/v8_base/src/accessors.o] Error 1
make: *** [x64.release] Error 2
/Users/ViswaMani/.rvm/gems/ruby-2.1.1@futura/gems/libv8-3.16.14.11/ext/libv8/location.rb:36:in `block in verify_installation!': libv8 did not install properly, expected binary v8 archive '/Users/ViswaMani/.rvm/gems/ruby-2.1.1@futura/gems/libv8-3.16.14.11/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/ViswaMani/.rvm/gems/ruby-2.1.1@futura/gems/libv8-3.16.14.11/ext/libv8/location.rb:35:in `each'
from /Users/ViswaMani/.rvm/gems/ruby-2.1.1@futura/gems/libv8-3.16.14.11/ext/libv8/location.rb:35:in `verify_installation!'
from /Users/ViswaMani/.rvm/gems/ruby-2.1.1@futura/gems/libv8-3.16.14.11/ext/libv8/location.rb:26:in `install!'
答案 0 :(得分:3)
如果您已安装libv8
,请将其删除并重新安装。
gem uninstall libv8
brew install v8
gem install therubyracer
gem install libv8 -v '3.16.14.3' -- --with-system-v8
或者,您可以安装特定版本
gem install libv8 -v 'XX.XX.XX' -- --with-system-v8