相关疑难解决方法(0)

therubyracer - Gem :: Ext :: BuildError:错误:无法构建gem原生扩展

我正在尝试在Mavericks上安装以下gem版本

  • libv8(3.16.14.3)
  • therubyracer(0.12.1)

显然,therubyracer宝石取决于libv8.

1)安装libv8

什么是libv8?我的一些研究似乎表明它是Google Chrome使用的某种javascript库?

我在安装它时遇到了麻烦,但是这个很棒的帖子既有我的错误,也有关于如何绕过它的解释清楚的答案.

所以我安装libv8

gem install libv8 -- --with-system-v8
Run Code Online (Sandbox Code Playgroud)

这是我的理解,这安装了gem,但使用我的本地系统安装v8库而不是... gem附带的版本?无论哪种方式,它都是成功的.

2)安装therubyracer

在下一步中,我在安装therubyracergem时遇到了麻烦.我不太确定这个gem是做什么的,只是因为它是我正在尝试的rails项目的依赖项bundle install.

它给了我以下错误:

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

    /Users/jeeves.butler/.rvm/rubies/ruby-1.9.2-p290/bin/ruby extconf.rb 
checking for main() in -lpthread... yes
checking for main() in -lobjc... yes
checking for v8.h... no
*** extconf.rb failed ***
Could not create Makefile due to some reason, probably lack of
necessary libraries and/or headers.  Check the mkmf.log file for more
details. …
Run Code Online (Sandbox Code Playgroud)

ruby gcc therubyracer libv8 osx-mavericks

73
推荐指数
6
解决办法
4万
查看次数

宝石安装libv8 - 版本'3.11.8.17'在ruby(windows)上

问题如下.

Error installing libv8:
ERROR: Failed to build gem native extension.

    D:/Ruby193/bin/ruby.exe extconf.rb
    creating Makefile
    The system can not find the specified path

        D:Ruby193/lib/ruby/gems/1.9.1/gems/libv8-3.11.8.17/ext/libv8/builder.rb:49:in'setup_python!':libv8 requires python 2 to be installed in order to build,but it is currently not available (RuntimeError)
             from D:Ruby193/lib/ruby/gems/1.9.1/gems/libv8-3.11.8.17/ext/libv8/builder.rb:35:in 'block in build_libv8!'
             from D:Ruby193/lib/ruby/gems/1.9.1/gems/libv8-3.11.8.17/ext/libv8/builder.rb:34:in 'chdir'
             from D:Ruby193/lib/ruby/gems/1.9.1/gems/libv8-3.11.8.17/ext/libv8/builder.rb:34:in 'build_libv8!'
             from D:Ruby193/lib/ruby/gems/1.9.1/gems/libv8-3.11.8.17/ext/libv8/builder.rb:34:in 'install!'
             from extconf.rb:7: in '<main>'
I have installed the python27 and add the path.

python --version
Python 2.7.4
Run Code Online (Sandbox Code Playgroud)

然后我检查代码如下.

 def setup_python!
      # If python v2 cannot be …
Run Code Online (Sandbox Code Playgroud)

ruby-on-rails libv8

43
推荐指数
3
解决办法
3万
查看次数

libv8需要安装python 2才能构建--Windows

这就是我尝试在Windows上安装libv8的方法:

D:\projects\perfstats>gem install libv8
Fetching: libv8-3.16.14.1.gem (100%)
Temporarily enhancing PATH to include DevKit...
Building native extensions.  This could take a while...
ERROR:  Error installing libv8:
        ERROR: Failed to build gem native extension.

        D:/Ruby193/bin/ruby.exe extconf.rb
creating Makefile
The system cannot find the path specified.
The system cannot find the path specified.
The system cannot find the path specified.
D:/Ruby193/lib/ruby/gems/1.9.1/gems/libv8-3.16.14.1/ext/libv8/builder.rb:49:in `setup_python!': libv8 requires python 2 to be installed in order to build, but it is currently not available (RuntimeError)
        from D:/Ruby193/lib/ruby/gems/1.9.1/gems/libv8-3.16.14.1/ext/libv8/builder.rb:35:in `block …
Run Code Online (Sandbox Code Playgroud)

python ruby-on-rails

13
推荐指数
2
解决办法
9927
查看次数

标签 统计

libv8 ×2

ruby-on-rails ×2

gcc ×1

osx-mavericks ×1

python ×1

ruby ×1

therubyracer ×1