rubyracer gem -v 0.10.1

时间:2016-12-29 14:56:26

标签: ruby-on-rails rubygems therubyracer

尝试捆绑安装但失败并出现以下错误:

        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

使用

  • rails 3.2.6
  • ruby​​ 1.9.3
  • ubuntu 16.10

试图安装libv8 -v = 3.3.10然后卸载它,也尝试安装新版本的libv8,仍然没用。

1 个答案:

答案 0 :(得分:0)

您可以尝试使用brew安装libv8。请试试这个。

<script src="https://cdnjs.cloudflare.com/ajax/libs/jquery/2.2.4/jquery.min.js"></script>
<script src="https://cdnjs.cloudflare.com/ajax/libs/jqueryui/1.12.1/jquery-ui.min.js"></script>
<link href="https://cdnjs.cloudflare.com/ajax/libs/jqueryui/1.12.1/jquery-ui.min.css" rel="stylesheet"/>
    <div id="low">
    <select id="dropdown_01">
        <option>Option 1</option>
        <option>Option 2</option>
        <option>Option 3</option>
        <option>Option 4</option>
        <option>Option 5</option>
    </select>
    </div>
    <div id="medium">
    <select id="dropdown_02">
        <option>Option A</option>
        <option>Option B</option>
        <option>Option C</option>
        <option>Option D</option>
        <option>Option E</option>
    </select>
    </div>
    <div id="high">
    <select id="dropdown_03">
        <option>Option a</option>
        <option>Option b</option>
        <option>Option c</option>
        <option>Option d</option>
        <option>Option e</option>
    </select>
    </div>