rubyjs / therubyracer

Embed the V8 Javascript Interpreter into Ruby
1.66k stars 191 forks source link

therubyracer install error on OSX 10.10.4 with CLT 6.4 #344

Closed phyzzld closed 9 years ago

phyzzld commented 9 years ago

I just upgraded to Command Line Tools 6.4 on 10.10.4, but I cannot install therubyracer 0.12.2. Initially both libv8 and therubyracer failed to install, but I reinstalled ruby 2.0.0-p353 after the upgrade and now libv8 3.16.14.8 installs with no problems but therubyracer still fails. I'm new to ruby. Any help is appreciated.

Error message from bundle install:

Installing therubyracer 0.12.2 with native extensions

Gem::Installer::ExtensionBuildError: ERROR: Failed to build gem native extension.

    /Users/***/.rbenv/versions/2.0.0-p353/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="
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:3915:36: error: 'v8::PropertyHandlerFlags' is not a class, namespace, or scoped enumeration
      PropertyHandlerFlags flags = PropertyHandlerFlags::kNone)
                                   ^
/usr/local/include/v8.h:3943:36: error: 'v8::PropertyHandlerFlags' is not a class, namespace, or scoped enumeration
      PropertyHandlerFlags flags = PropertyHandlerFlags::kNone)
                                   ^
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 ','
./rr.h:361:48: error: no member named 'ScriptData' in namespace 'v8'
  inline ScriptData(VALUE value) : Pointer<v8::ScriptData>(value) {}
                                           ~~~~^
./rr.h:361:59: error: expected class member or base class name
  inline ScriptData(VALUE value) : Pointer<v8::ScriptData>(value) {}
                                                          ^
./rr.h:361:59: error: expected '{' or ','
./rr.h:463:14: error: no type named 'AccessorGetter' in namespace 'v8'
  inline v8::AccessorGetter accessorGetter() {return &AccessorGetter;}
         ~~~~^
./rr.h:464:14: error: no type named 'AccessorSetter' in namespace 'v8'
  inline v8::AccessorSetter accessorSetter() {return RTEST(set) ? &AccessorSetter : 0;}
         ~~~~^
./rr.h:466:14: error: no type named 'NamedPropertyGetter' in namespace 'v8'
  inline v8::NamedPropertyGetter namedPropertyGetter() {return &NamedPropertyGetter;}
         ~~~~^
./rr.h:467:14: error: no type named 'NamedPropertySetter' in namespace 'v8'
  inline v8::NamedPropertySetter namedPropertySetter() {return RTEST(set) ? &NamedPropertySetter : 0;}
         ~~~~^
./rr.h:468:14: error: no type named 'NamedPropertyQuery' in namespace 'v8'
  inline v8::NamedPropertyQuery namedPropertyQuery() {return RTEST(query) ? &NamedPropertyQuery : 0;}
         ~~~~^
./rr.h:469:14: error: no type named 'NamedPropertyDeleter' in namespace 'v8'
  inline v8::NamedPropertyDeleter namedPropertyDeleter() {return RTEST(deleter) ? &NamedPropertyDeleter : 0;}
         ~~~~^
./rr.h:470:14: error: no type named 'NamedPropertyEnumerator' in namespace 'v8'
  inline v8::NamedPropertyEnumerator namedPropertyEnumerator() {return RTEST(enumerator) ? &NamedPropertyEnumerator : 0;}
         ~~~~^
./rr.h:472:14: error: no type named 'IndexedPropertyGetter' in namespace 'v8'
  inline v8::IndexedPropertyGetter indexedPropertyGetter() {return &IndexedPropertyGetter;}
         ~~~~^
fatal error: too many errors emitted, stopping now [-ferror-limit=]
20 errors generated.
make: *** [accessor.o] Error 1

Gem files will remain installed in /Users/***/.rbenv/versions/2.0.0-p353/lib/ruby/gems/2.0.0/gems/therubyracer-0.12.2 for inspection.
Results logged to /Users/***/.rbenv/versions/2.0.0-p353/lib/ruby/gems/2.0.0/gems/therubyracer-0.12.2/ext/v8/gem_make.out
An error occurred while installing therubyracer (0.12.2), and Bundler cannot continue.
Make sure that `gem install therubyracer -v '0.12.2'` succeeds before bundling.
kevin-jj commented 9 years ago

I ran into the same issue.

Gem::Ext::BuildError: ERROR: Failed to build gem native extension.

    /Users/liujun/.rvm/rubies/ruby-2.1.5/bin/ruby -r ./siteconf20150701-965-1v925iy.rb 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/liujun/.rvm/gems/ruby-2.1.5@wedding/gems/libv8-3.16.14.8/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/liujun/.rvm/gems/ruby-2.1.5@wedding/gems/libv8-3.16.14.8/vendor/v8/out/x64.release/obj.target/v8_base/src/accessors.o] Error 1
make: *** [x64.release] Error 2
cowboyd commented 9 years ago

I'm working on getting TRR to compile with the latest version of the command line tools. In the meantime, you can try to manually install this binary gem which I have compiled on 10.4 using gcc 4.2.1

https://www.dropbox.com/s/fyusyxbpdzid6s8/therubyracer-0.12.2-x86_64-darwin-14.gem?dl=0

cowboyd commented 9 years ago

But this is basically a duplicate of #339