Gem установить therubyracer -v '0.11.4'?

Я почти сумасшедший, чтобы установитьtherubyracer, Я знаю, что у многих людей такая же проблема со мной, и я также рассматривал эти проблемы, однако это слишком сложно для меня, потому что разные ситуации имеют разные решения. И на самом деле, не было хорошего способа решить проблему. Моя проблема похожа наэтоти там естьобсуждение Об этом, однако, до сих пор нет никакого заключения.

Несмотря на это,этот это хороший вопрос, заданныйКрис С, но пришел не очень хороший результат.

Notes Вот некоторые заметки о моей проблеме:

1.ruby 2.2.1p85 (2015-02-26 редакция 49769) [x86_64-darwin15]

2.libv8 3.11.8.17 с собственными расширениями

② OS X El Capitan, 10.11

Messages Вот сообщения об ошибках:

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

/Users/hufeipeng/.rbenv/versions/2.2.1/bin/ruby -r ./siteconf20151026-41811-14t2l9a.rb extconf.rb

checking for main() in -lpthread... yes
checking for main() in -lobjc... yes
checking for v8.h... yes
creating Makefile

make "DESTDIR=" clean

make "DESTDIR="
compiling accessor.cc
clang: warning: argument unused during compilation: '-rdynamic'
In file included from accessor.cc:1:
In file included from ./rr.h:4:
/usr/local/include/v8.h:353:33: error: use of undeclared identifier 'nullptr'
V8_INLINE MaybeLocal() : val_(nullptr) {}
                            ^
/usr/local/include/v8.h:360:51: error: use of undeclared identifier 'nullptr'
V8_INLINE bool IsEmpty() const { return val_ == nullptr; }
                                              ^
/usr/local/include/v8.h:364:29: error: use of undeclared identifier 'nullptr'
out->val_ = IsEmpty() ? nullptr : this->val_;
                        ^
/usr/local/include/v8.h:430:50: error: use of undeclared identifier 'nullptr'
bool IsFirstPass() const { return callback_ != nullptr; }
                                             ^
/usr/local/include/v8.h:790:42: error: use of undeclared identifier 'nullptr'
V8_INLINE Global() : PersistentBase<T>(nullptr) {}
                                     ^
/usr/local/include/v8.h:815:18: error: use of undeclared identifier 'nullptr'
other.val_ = nullptr;
             ^
/usr/local/include/v8.h:827:18: error: use of undeclared identifier 'nullptr'
rhs.val_ = nullptr;
             ^
/usr/local/include/v8.h:1092:52: error: use of undeclared identifier 'nullptr'
ScriptOrigin* origin = nullptr));
                         ^
/usr/local/include/v8config.h:347:48: note: expanded from macro 'V8_DEPRECATE_SOON'
#define V8_DEPRECATE_SOON(message, declarator) declarator
                                           ^
In file included from accessor.cc:1:
In file included from ./rr.h:4:
/usr/local/include/v8.h:1095:30: error: use of undeclared identifier 'nullptr'
ScriptOrigin* origin = nullptr);
                         ^
/usr/local/include/v8.h:2283:42: error: 'v8::NewStringType' is not a class, namespace, or scoped enumeration
kNormalString = static_cast<int>(v8::NewStringType::kNormal),
                                     ^
/usr/local/include/v8.h:2284:48: error: 'v8::NewStringType' is not a class, namespace, or scoped enumeration
kInternalizedString = static_cast<int>(v8::NewStringType::kInternalized)
                                           ^
/usr/local/include/v8.h:3205:36: error: use of undeclared identifier 'nullptr'
return NewInstance(context, 0, nullptr);
                               ^
/usr/local/include/v8.h:3434:38: error: 'v8::ArrayBufferCreationMode' is not a class, namespace, or scoped enumeration
ArrayBufferCreationMode mode = ArrayBufferCreationMode::kExternalized);
                                 ^
/usr/local/include/v8.h:3797:38: error: 'v8::ArrayBufferCreationMode' is not a class, namespace, or scoped enumeration
ArrayBufferCreationMode mode = ArrayBufferCreationMode::kExternalized);
                                 ^
/usr/local/include/v8.h:4457:36: error: 'v8::PropertyHandlerFlags' is not a class, namespace, or scoped enumeration
PropertyHandlerFlags flags = PropertyHandlerFlags::kNone)
                             ^
/usr/local/include/v8.h:4485:36: error: 'v8::PropertyHandlerFlags' is not a class, namespace, or scoped enumeration
PropertyHandlerFlags flags = PropertyHandlerFlags::kNone)
                             ^
/usr/local/include/v8.h:7151:27: error: use of undeclared identifier 'nullptr'
if (V8_UNLIKELY(val_ == nullptr)) V8::ToLocalEmpty();
                        ^
/usr/local/include/v8config.h:353:54: note: expanded from macro 'V8_UNLIKELY'
# define V8_UNLIKELY(condition) (__builtin_expect(!!(condition), 0))
                                                 ^
In file included from accessor.cc:1:
In file included from ./rr.h:4:
/usr/local/include/v8.h:7596:46: error: 'v8::NewStringType' is not a class, namespace, or scoped enumeration
Set(v8::String::NewFromUtf8(isolate, name, NewStringType::kNormal)
                                         ^
In file included from accessor.cc:1:
./rr.h:358:39: error: no member named 'ScriptData' in namespace 'v8'
class ScriptData : public Pointer<v8::ScriptData> {
                              ~~~~^
fatal error: too many errors emitted, stopping now [-ferror-limit=]
20 errors generated.
make: *** [accessor.o] Error 1

make failed, exit code 2

Gem files will remain installed in
/Users/*/.rbenv/versions/2.2.1/lib/ruby/gems/2.2.0/gems/therubyracer-0.11.4 for inspection.
Results logged to
/Users/*/.rbenv/versions/2.2.1/lib/ruby/gems/2.2.0/extensions/x86_64-darwin-15/2.2.0-static/therubyracer-0.11.4/gem_make.out

Помогите!

Ну, во-первых, мне очень жаль переосмысливать проблему снова, слишком занят, чтобы успеть заметить комментарии, которые ваши парни ответили за меня. И здесь, я так ценю, что @Javid Jamae предоставляет мне отличный способ решить эту проблему, хотя есть еще несколько небольших вопросов, которые нужно решить, но это нормально, что нам просто нужны ошибки, чтобы помочь нам найти окончательный ответ Ниже приведена консоль после того, как я попробовал @Javid Jamae way,

Во-первых, я не установилНКУ сзаваривать до этого, поэтому я установил его с Brew и версия является последней5.2.0 (/usr/local/Cellar/gcc/5.2.0). Вот подробности:

➜  /Users/xxx  >brew install gcc
==> Installing dependencies for gcc: gmp, mpfr, libmpc, isl
==> Installing gcc dependency: gmp
==> Downloading https://homebrew.bintray.com/bottles/gmp-6.0.0a.el_capitan.bottle.tar.gz
######################################################################## 100.0%
==> Pouring gmp-6.0.0a.el_capitan.bottle.tar.gz
  /usr/local/Cellar/gmp/6.0.0a: 15 files, 3.2M
==> Installing gcc dependency: mpfr
==> Downloading https://homebrew.bintray.com/bottles/mpfr-3.1.3.el_capitan.bottle.tar.gz
######################################################################## 100.0%
==> Pouring mpfr-3.1.3.el_capitan.bottle.tar.gz
  /usr/local/Cellar/mpfr/3.1.3: 24 files, 3.6M
==> Installing gcc dependency: libmpc
==> Downloading https://homebrew.bintray.com/bottles/libmpc-1.0.3.el_capitan.bottle.tar.gz
######################################################################## 100.0%
==> Pouring libmpc-1.0.3.el_capitan.bottle.tar.gz
  /usr/local/Cellar/libmpc/1.0.3: 10 files, 380K
==> Installing gcc dependency: isl
==> Downloading https://homebrew.bintray.com/bottles/isl-0.14.1.el_capitan.bottle.3.tar.gz
######################################################################## 100.0%
==> Pouring isl-0.14.1.el_capitan.bottle.3.tar.gz
  /usr/local/Cellar/isl/0.14.1: 68 files, 3.2M
==> Installing gcc
==> Downloading https://homebrew.bintray.com/bottles/gcc-5.2.0.el_capitan.bottle.2.tar.gz
##################### 29.8%
curl: (56) SSLRead() return error -9806
Error: Failed to download resource "gcc"
Download failed: https://homebrew.bintray.com/bottles/gcc-5.2.0.el_capitan.bottle.2.tar.gz
Warning: Bottle installation failed: building from source.
==> Downloading http://ftpmirror.gnu.org/gcc/gcc-5.2.0/gcc-5.2.0.tar.bz2
==> Downloading from http://mirrors.ustc.edu.cn/gnu/gcc/gcc-5.2.0/gcc-5.2.0.tar.bz2
######################################################################## 100.0%
==> Patching
patching file gcc/jit/Make-lang.in
patching file gcc/jit/jit-playback.c
Hunk #1 succeeded at 2459 with fuzz 2 (offset 43 lines).
==> ../configure --build=x86_64-apple-darwin15.0.0 --prefix=/usr/local/Cellar/gcc/5.2.0 --libdir=/usr/local/Cel
==> make bootstrap
==> make install
==> Caveats
GCC has been built with multilib support. Notably, OpenMP may not work:
https://gcc.gnu.org/bugzilla/show_bug.cgi?id=60670
If you need OpenMP support you may want to brew reinstall gcc --without-multilib
==> Summary
  /usr/local/Cellar/gcc/5.2.0: 1353 files, 248M, built in 52.4 minutes

Кажется, установка в порядке! А потом я удалилtherubyracer а такжеlibv8 с драгоценными камнями. Однако, когда дело доходит до установкиtherubyracer (Я не указывал версию при установке или вGemfileисверток напомни мне версию0.12.2 Это необходимо), появляется ошибка:

➜  /Users/xxx/Documents/workspace/xxx git:(master) ✗ >gem install therubyracer -v '0.12.2'
Fetching: libv8-3.16.14.13.gem (100%)
Building native extensions.  This could take a while...
ERROR:  Error installing therubyracer:
ERROR: Failed to build gem native extension.
/Users/xxx/.rbenv/versions/2.2.1/bin/ruby -r ./siteconf20151230-50968-1yqguip.rb extconf.rb
creating Makefile
Compiling v8 for x64
Using python 2.7.10
Using compiler: /usr/bin/c++ (clang version 6.1.0)
/Applications/Xcode.app/Contents/Developer/Toolchains/XcodeDefault.xctoolchain/usr/bin/libtool: file:
/Users/xxx/.rbenv/versions/2.2.1/lib/ruby/gems/2.2.0/gems/libv8-3.16.14.13/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/xxx/.rbenv/versions/2.2.1/lib/ruby/gems/2.2.0/gems/libv8-3.16.14.13/vendor/v8/out/x64.release/obj.target/v8_base/src/accessors.o]
Error 1
make: *** [x64.release] Error 2
/Users/xxx/.rbenv/versions/2.2.1/lib/ruby/gems/2.2.0/gems/libv8-3.16.14.13/ext/libv8/location.rb:36:in `block in verify_installation!': libv8 did not install properly, expected binary v8 archive '
/Users/xxx/.rbenv/versions/2.2.1/lib/ruby/gems/2.2.0/gems/libv8-3.16.14.13/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/xxx/.rbenv/versions/2.2.1/lib/ruby/gems/2.2.0/gems/libv8-3.16.14.13/ext/libv8/location.rb:35:in `each'
from
/Uses/xxx/.rbenv/versions/2.2.1/lib/ruby/gems/2.2.0/gems/libv8-3.16.14.13/ext/libv8/location.rb:35:in `verify_installation!'
from
/Users/xxx/.rbenv/versions/2.2.1/lib/ruby/gems/2.2.0/gems/libv8-3.16.14.13/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 -Dwerror=''
CXX(target)
/Users/xxx/.rbenv/versions/2.2.1/lib/ruby/gems/2.2.0/gems/libv8-3.16.14.13/vendor/v8/out/x64.release/obj.target/preparser_lib/src/allocation.o
CXX(target)
/Users/xxx/.rbenv/versions/2.2.1/lib/ruby/gems/2.2.0/gems/libv8-3.16.14.13/vendor/v8/out/x64.release/obj.target/preparser_lib/src/atomicops_internals_x86_gcc.o
CXX(target)
/Users/xxx/.rbenv/versions/2.2.1/lib/ruby/gems/2.2.0/gems/libv8-3.16.14.13/vendor/v8/out/x64.release/obj.target/preparser_lib/src/bignum.o
.................. (the follow error messages are similar to above)

Ну, мне интересно, что это все еще проблемаlibv8! Сначала, я думаю, что это может быть проблема версииtherubyracer, поэтому я должен был попробовать установить версию0.12.0К сожалению, там такие же ошибки. Там что-то странное, я имею в видуlibv8 устанавливается вместе сtherubyracer в моем случае (см. это из сообщений об ошибках), но вы со мной по-другому. Как ваше предложение отмечено, вы устанавливаетеlibv8 после того, как вы установилиtherubyracerпочему они разные? Может быть, это связано с моимРубин Настройки среды, здесь я разместил свойGemfile конфигурация:

gem 'rails', '4.1.6'
gem 'mysql2', '0.3.18'
gem 'sass-rails', '~> 4.0.3'
gem 'bootstrap-sass', '~> 3.3.4'
gem 'uglifier', '>= 1.3.0'
gem 'coffee-rails', '~> 4.0.0'

gem 'therubyracer', platforms: :ruby

gem 'jquery-rails','3.1.2'
gem 'jquery-ui-rails', '4.0.5'
gem 'turbolinks'
gem 'jbuilder', '~> 2.0'
gem 'sdoc', '~> 0.4.0', group: :doc

gem 'log4r', '1.1.9'
gem 'devise','3.4.1'
gem 'carrierwave', '0.10.0'
gem 'mini_magick', '3.6.0'
gem 'thin','1.6.2'
gem 'kaminari', '0.16.1'
gem 'factory_girl_rails'
gem 'httparty'
gem "select2-rails",'3.5.9.3'

group :test, :development do
    gem 'net-ssh', '2.7.0'
    gem 'capistrano', '2.12.0'
    gem 'capistrano-rbenv', '1.0.1'
    gem 'spring'
    gem 'magic_encoding', '0.0.2'
    gem 'rspec-rails', '3.2.0'
end

Ответы на вопрос(0)

Ваш ответ на вопрос