3

正在使用的FreeBSD操作系统,当我尝试安装libv8,Ruby on Rails的安装了FreeBSD操作系统 - 错误在libv8

gem install libv8 

它抛出一个错误...

Building native extensions. This could take a while... 
ERROR: Error installing therubyracer: 
ERROR: Failed to build gem native extension. 

     /usr/local/bin/ruby18 extconf.rb 
*** 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. You may need configuration options. 

Provided configuration options: 
    --with-opt-dir 
    --without-opt-dir 
    --with-opt-include 
    --without-opt-include=${opt-dir}/include 
    --with-opt-lib 
    --without-opt-lib=${opt-dir}/lib 
    --with-make-prog 
    --without-make-prog 
    --srcdir=. 
    --curdir 
    --ruby=/usr/local/bin/ruby18 
extconf.rb:13: uninitialized constant Gem (NameError) 
Checking for Python... 


extconf.rb:13: uninitialized constant Gem 

我已经icluded

gem 'therubyracer' 
gem 'libv8', '3.3.10.4' 
在宝石文件

..

+0

@shingara你能看到任何问题吗? – Shanib 2012-03-01 08:42:57

+0

你有没有在freeBSD上安装node.js? – shingara 2012-03-01 08:43:58

+0

@ shingara ..没有它可以做.. – Shanib 2012-03-01 09:00:15

回答

2

这可能发生在Ruby 1.8.7中,它不会像1.9.x那样自动包含ruby gems。这里有一个更新github:https://github.com/fractaloop/libv8/blob/master/ext/libv8/extconf.rb

但是,这似乎并没有在发布的宝石在这个时候。它应该是因为安装这样那样容易:

gem 'libv8', :git => 'git://github.com/fractaloop/libv8.git' 

但是从看来源,其动态宝石版采用了版本的V8库的关联,而当我试了一下,失败了,说:它是版本0.0.4。我在不同的操作系统上,所以试试看看它是否适合你。

+0

对于其他人来说,execjs可以与其他javascript运行时一起工作。如果你不能使rubyracer/libv8工作,请尝试使用node.js。这对我使用OpenIndiana/OpenSolaris更容易。 – 2012-03-02 12:26:04

+0

仍然显示错误? – SHANib 2012-03-05 08:54:53