rubyjs / therubyracer

Embed the V8 Javascript Interpreter into Ruby
1.67k stars 190 forks source link

Can't install on El Capitan #402

Closed benson-basis closed 8 years ago

benson-basis commented 8 years ago
Gem::Ext::BuildError: ERROR: Failed to build gem native extension.

    /usr/local/Cellar/ruby/2.1.2_3/bin/ruby extconf.rb
checking for main() in -lpthread... yes
checking for main() in -lobjc... yes
checking for v8.h... yes
checking for main() in -lv8... 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:355:33: error: use of undeclared identifier 'nullptr'
  V8_INLINE MaybeLocal() : val_(nullptr) {}
                                ^
/usr/local/include/v8.h:362:51: error: use of undeclared identifier 'nullptr'
  V8_INLINE bool IsEmpty() const { return val_ == nullptr; }
                                                  ^
/usr/local/include/v8.h:366:29: error: use of undeclared identifier 'nullptr'
    out->val_ = IsEmpty() ? nullptr : this->val_;
                            ^
/usr/local/include/v8.h:432:50: error: use of undeclared identifier 'nullptr'
  bool IsFirstPass() const { return callback_ != nullptr; }
                                                 ^
/usr/local/include/v8.h:803:42: error: use of undeclared identifier 'nullptr'
  V8_INLINE Global() : PersistentBase<T>(nullptr) {}
                                         ^
/usr/local/include/v8.h:828:18: error: use of undeclared identifier 'nullptr'
    other.val_ = nullptr;
                 ^
/usr/local/include/v8.h:840:18: error: use of undeclared identifier 'nullptr'
      rhs.val_ = nullptr;
                 ^
/usr/local/include/v8.h:1105:52: error: use of undeclared identifier 'nullptr'
                            ScriptOrigin* origin = nullptr));
                                                   ^
/usr/local/include/v8config.h:364: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:1108:30: error: use of undeclared identifier 'nullptr'
      ScriptOrigin* origin = nullptr);
                             ^
/usr/local/include/v8.h:2289:42: error: 'v8::NewStringType' is not a class, namespace, or scoped enumeration
    kNormalString = static_cast<int>(v8::NewStringType::kNormal),
                                         ^
/usr/local/include/v8.h:2290:48: error: 'v8::NewStringType' is not a class, namespace, or scoped enumeration
    kInternalizedString = static_cast<int>(v8::NewStringType::kInternalized)
                                               ^
/usr/local/include/v8.h:3250:36: error: use of undeclared identifier 'nullptr'
    return NewInstance(context, 0, nullptr);
                                   ^
/usr/local/include/v8.h:3479:38: error: 'v8::ArrayBufferCreationMode' is not a class, namespace, or scoped enumeration
      ArrayBufferCreationMode mode = ArrayBufferCreationMode::kExternalized);
                                     ^
/usr/local/include/v8.h:3842:38: error: 'v8::ArrayBufferCreationMode' is not a class, namespace, or scoped enumeration
      ArrayBufferCreationMode mode = ArrayBufferCreationMode::kExternalized);
                                     ^
/usr/local/include/v8.h:4528:36: error: 'v8::PropertyHandlerFlags' is not a class, namespace, or scoped enumeration
      PropertyHandlerFlags flags = PropertyHandlerFlags::kNone)
                                   ^
/usr/local/include/v8.h:4556:36: error: 'v8::PropertyHandlerFlags' is not a class, namespace, or scoped enumeration
      PropertyHandlerFlags flags = PropertyHandlerFlags::kNone)
                                   ^
/usr/local/include/v8.h:7262:27: error: use of undeclared identifier 'nullptr'
  if (V8_UNLIKELY(val_ == nullptr)) V8::ToLocalEmpty();
                          ^
/usr/local/include/v8config.h:370: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:7716: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
biggless commented 8 years ago

Same for me

gem install therubyracer
Building native extensions.  This could take a while...
ERROR:  Error installing therubyracer:
    ERROR: Failed to build gem native extension.

    current directory: /usr/local/lib/ruby/gems/2.3.0/gems/therubyracer-0.12.2/ext/v8
/usr/local/opt/ruby/bin/ruby -r ./siteconf20160323-93325-z8w7pt.rb extconf.rb
checking for main() in -lpthread... yes
checking for main() in -lobjc... yes
checking for v8.h... yes
checking for main() in -lv8... yes
creating Makefile

To see why this extension failed to compile, please check the mkmf.log which can be found here:

  /usr/local/lib/ruby/gems/2.3.0/extensions/x86_64-darwin-15/2.3.0/therubyracer-0.12.2/mkmf.log

current directory: /usr/local/lib/ruby/gems/2.3.0/gems/therubyracer-0.12.2/ext/v8
make "DESTDIR=" clean

current directory: /usr/local/lib/ruby/gems/2.3.0/gems/therubyracer-0.12.2/ext/v8
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:360:33: error: use of undeclared identifier 'nullptr'
  V8_INLINE MaybeLocal() : val_(nullptr) {}
                                ^
/usr/local/include/v8.h:367:51: error: use of undeclared identifier 'nullptr'
  V8_INLINE bool IsEmpty() const { return val_ == nullptr; }
                                                  ^
/usr/local/include/v8.h:371:29: error: use of undeclared identifier 'nullptr'
    out->val_ = IsEmpty() ? nullptr : this->val_;
                            ^
/usr/local/include/v8.h:437:50: error: use of undeclared identifier 'nullptr'
  bool IsFirstPass() const { return callback_ != nullptr; }
                                                 ^
/usr/local/include/v8.h:808:42: error: use of undeclared identifier 'nullptr'
  V8_INLINE Global() : PersistentBase<T>(nullptr) {}
                                         ^
/usr/local/include/v8.h:833:18: error: use of undeclared identifier 'nullptr'
    other.val_ = nullptr;
                 ^
/usr/local/include/v8.h:845:18: error: use of undeclared identifier 'nullptr'
      rhs.val_ = nullptr;
                 ^
/usr/local/include/v8.h:1110:52: error: use of undeclared identifier 'nullptr'
                            ScriptOrigin* origin = nullptr));
                                                   ^
/usr/local/include/v8.h:1113:30: error: use of undeclared identifier 'nullptr'
      ScriptOrigin* origin = nullptr);
                             ^
/usr/local/include/v8.h:3242:36: error: use of undeclared identifier 'nullptr'
    return NewInstance(context, 0, nullptr);
                                   ^
/usr/local/include/v8.h:4457:57: error: use of undeclared identifier 'nullptr'
      experimental::FastAccessorBuilder* fast_handler = nullptr,
                                                        ^
/usr/local/include/v8.h:4473:57: error: use of undeclared identifier 'nullptr'
      experimental::FastAccessorBuilder* fast_handler = nullptr);
                                                        ^
/usr/local/include/v8.h:7292:27: error: use of undeclared identifier 'nullptr'
  if (V8_UNLIKELY(val_ == nullptr)) V8::ToLocalEmpty();
                          ^
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> {
                                  ~~~~^
./rr.h:358:51: error: expected class name
class ScriptData : public Pointer<v8::ScriptData> {
                                                  ^
./rr.h:360:21: error: no type named 'ScriptData' in namespace 'v8'; did you mean simply 'ScriptData'?
  inline ScriptData(v8::ScriptData* d) : Pointer<v8::ScriptData>(d) {};
                    ^~~~~~~~~~~~~~
                    ScriptData
./rr.h:358:7: note: 'ScriptData' declared here
class ScriptData : public Pointer<v8::ScriptData> {
      ^
./rr.h:360:54: error: no member named 'ScriptData' in namespace 'v8'
  inline ScriptData(v8::ScriptData* d) : Pointer<v8::ScriptData>(d) {};
                                                 ~~~~^
./rr.h:360:65: error: expected class member or base class name
  inline ScriptData(v8::ScriptData* d) : Pointer<v8::ScriptData>(d) {};
                                                                ^
./rr.h:360:65: error: expected '{' or ','
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 /usr/local/lib/ruby/gems/2.3.0/gems/therubyracer-0.12.2 for inspection.
Results logged to /usr/local/lib/ruby/gems/2.3.0/extensions/x86_64-darwin-15/2.3.0/therubyracer-0.12.2/gem_make.out
faheempatel commented 8 years ago

@benson-basis, @Biggless: If it helps, I was able to get things working using these instructions.

ignisf commented 8 years ago

There has been a new release of libv8 that should address most OS X install issues. Closing for now.