rubyjs / therubyracer

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

mac os 10.9 can't install #269

Closed eddiefisher closed 11 years ago

eddiefisher commented 11 years ago

gemfile:

gem 'libv8', '~> 3.11.8'
gem 'therubyracer', '~> 0.11.4', :require => 'v8'

error full: http://cl.ly/1m380d2u0J0s

/Users/eddiefisher/.rvm/rubies/ruby-2.0.0-head/bin/ruby extconf.rb --with-system-v8
checking for main() in -lpthread... yes
checking for main() in -lobjc... yes
checking for v8.h... yes
creating Makefile

make "DESTDIR="
compiling accessor.cc
clang: warning: argument unused during compilation: '-rdynamic'
accessor.cc:63:32: error: calling a private constructor of class 'v8::Handle<v8::External>'
      v8::Handle<v8::External> external(v8::External::Cast(*value));
                               ^
/usr/local/include/v8.h:360:22: note: declared private here
  V8_INLINE(explicit Handle(T* val)) : val_(val) {}
                     ^
/usr/local/include/v8.h:80:69: note: expanded from macro 'V8_INLINE'
#define V8_INLINE(declarator) inline __attribute__((always_inline)) declarator
                                                                    ^
In file included from accessor.cc:1:
./rr.h:235:41: error: 'New' is a private member of 'v8::Persistent<v8::String>'
      this->handle = v8::Persistent<T>::New(handle);
                                        ^
./rr.h:187:87: note: in instantiation of member function 'rr::Ref<v8::String>::Holder::Holder' requested here
    return handle.IsEmpty() ? Qnil : Data_Wrap_Struct(Class, 0, &Holder::enqueue, new Holder(handle));
                                                                                      ^
/Users/eddiefisher/.rvm/rubies/ruby-2.0.0-head/include/ruby-2.0.0/ruby/ruby.h:1008:35: note: expanded from macro 'Data_Wrap_Struct'
    rb_data_object_alloc((klass),(sval),(RUBY_DATA_FUNC)(mark),(RUBY_DATA_FUNC)(free))
                                  ^
accessor.cc:130:72: note: in instantiation of member function 'rr::Ref<v8::String>::operator unsigned long' requested here
    return Value(rb_funcall(accessor.get, rb_intern("call"), 2, (VALUE)String(property), (VALUE)*this));
                                                                       ^
/usr/local/include/v8.h:781:23: note: declared private here
  V8_INLINE(static T* New(Isolate* isolate, T* that));
                      ^
/usr/local/include/v8.h:80:69: note: expanded from macro 'V8_INLINE'
#define V8_INLINE(declarator) inline __attribute__((always_inline)) declarator
                                                                    ^
In file included from accessor.cc:1:
./rr.h:235:51: error: too few arguments to function call, expected 2, have 1
      this->handle = v8::Persistent<T>::New(handle);
                     ~~~~~~~~~~~~~~~~~~~~~~       ^
/usr/local/include/v8.h:781:3: note: 'New' declared here
  V8_INLINE(static T* New(Isolate* isolate, T* that));
  ^
/usr/local/include/v8.h:80:31: note: expanded from macro 'V8_INLINE'
#define V8_INLINE(declarator) inline __attribute__((always_inline)) declarator
                              ^
In file included from accessor.cc:1:
./rr.h:196:14: error: no viable conversion from 'v8::Persistent<Array>' to 'v8::Handle<Array>'
      return holder->handle;
             ^~~~~~~~~~~~~~
cowboyd commented 11 years ago

It appears, that you have specified --with-system-v8 which will attempt to use the v8 from the system location and not from the libv8 gem. In this case, the version of v8 on your system should be API compatible with 3.11.8, which it appears it is not.

I would suggest either compiling without this flag, or using a compatible system v8.

cowboyd commented 11 years ago

0.12.0 has just been released. This may solve your problem.