installation faild for rubyracer gem -v 0.10.1

550 views Asked by At

Trying to bundle install but it fails and gives following error:

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

        current directory: /home/.rvm/gems/ruby-1.9.3-p551@sp/gems/therubyracer-0.10.1/ext/v8
    /home/.rvm/rubies/ruby-1.9.3-p551/bin/ruby -r ./siteconf20161229-26285-j4qz96.rb extconf.rb
    creating Makefile

    current directory: /home/.rvm/gems/ruby-1.9.3-p551@sp/gems/therubyracer-0.10.1/ext/v8
    make  clean

    current directory: /home/.rvm/gems/ruby-1.9.3-p551@sp/gems/therubyracer-0.10.1/ext/v8
    make
    compiling v8_script.cpp
    cc1plus: warning: command line option ‘-Wdeclaration-after-statement’ is valid for C/ObjC but not for C++
    cc1plus: warning: command line option ‘-Wimplicit-function-declaration’ is valid for C/ObjC but not for C++
    In file included from v8_script.cpp:2:0:
    v8_handle.h: In instantiation of ‘v8::Persistent<T>& rr_v8_handle(VALUE) [with T = v8::Script; VALUE = long unsigned int]’:
    v8_script.cpp:25:56:   required from here
    v8_handle.h:43:10: warning: dereferencing type-punned pointer will break strict-aliasing rules [-Wstrict-aliasing]
       return (v8::Persistent<T>&)(rr_v8_handle_raw(value)->payload->handle);
              ^~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
    compiling v8_locker.cpp
    cc1plus: warning: command line option ‘-Wdeclaration-after-statement’ is valid for C/ObjC but not for C++
    cc1plus: warning: command line option ‘-Wimplicit-function-declaration’ is valid for C/ObjC but not for C++
    v8_locker.cpp: In function ‘VALUE {anonymous}::Lock::Delete(VALUE)’:
    v8_locker.cpp:45:5: warning: no return statement in function returning non-void [-Wreturn-type]
         }
compiling v8.cpp
cc1plus: warning: command line option ‘-Wdeclaration-after-statement’ is valid for C/ObjC but not for C++
cc1plus: warning: command line option ‘-Wimplicit-function-declaration’ is valid for C/ObjC but not for C++
compiling v8_try_catch.cpp
cc1plus: warning: command line option ‘-Wdeclaration-after-statement’ is valid for C/ObjC but not for C++
cc1plus: warning: command line option ‘-Wimplicit-function-declaration’ is valid for C/ObjC but not for C++
v8_try_catch.cpp: In function ‘v8::TryCatch* {anonymous}::unwrap(VALUE)’:
v8_try_catch.cpp:15:14: error: cannot convert ‘bool’ to ‘v8::TryCatch*’ in return
       return false;
              ^~~~~
Makefile:198: recipe for target 'v8_try_catch.o' failed
make: *** [v8_try_catch.o] Error 1

make failed, exit code 2

Gem files will remain installed in /home/.rvm/gems/ruby-1.9.3-p551@sp/gems/therubyracer-0.10.1 for inspection.
Results logged to /home/.rvm/gems/ruby-1.9.3-p551@sp/extensions/x86-linux/1.9.1/therubyracer-0.10.1/gem_make.out

Using

  • rails 3.2.6
  • ruby 1.9.3
  • ubuntu 16.10

Tried to install libv8 -v=3.3.10 then uninstall it, also tried installing new version libv8, still no use.

1

There are 1 answers

0
Jyoti mishra On

You can try installing libv8 using brew. Please try this.

$ gem uninstall libv8
$ brew install v8
$ gem install therubyracer  or $ gem install therubyracer -v=0.10.1