0

尝试安装 therubyracer gem 后出现以下错误。

不知道为什么当我已经下载了 gem 时它会抱怨 v8。

我最初在安装 libv8 时遇到了麻烦,但后来设法使用 --system-v8 标志进行安装,但现在它的 ruby​​racer 抱怨。

Gem::Installer::ExtensionBuildError: ERROR: Failed to build gem native extension.

    /home/glenn/.rvm/rubies/ruby-1.9.3-p392/bin/ruby extconf.rb 
checking for main() in -lpthread... 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.  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=/home/glenn/.rvm/rubies/ruby-1.9.3-p392/bin/ruby
    --with-pthreadlib
    --without-pthreadlib
    --enable-debug
    --disable-debug
    --with-v8-dir
    --without-v8-dir
    --with-v8-include
    --without-v8-include=${v8-dir}/include
    --with-v8-lib
    --without-v8-lib=${v8-dir}/
/home/glenn/.rvm/gems/ruby-1.9.3-p392/gems/libv8-3.11.8.17/ext/libv8/location.rb:50:in `configure': You have chosen to use the version of V8 found on your system (Libv8::Location::System::NotFoundError)
and *not* the one that is bundle with the libv8 rubygem. However,
it could not be located. please make sure you have a version of
v8 that is compatible with 3.11.8.17 installed. You may
need to special --with-v8-dir options if it is in a non-standard
location

thanks,
The Mgmt

    from /home/glenn/.rvm/gems/ruby-1.9.3-p392/gems/libv8-3.11.8.17/lib/libv8.rb:7:in `configure_makefile'
    from extconf.rb:32:in `<main>'


Gem files will remain installed in /home/glenn/.rvm/gems/ruby-1.9.3-p392/gems/therubyracer-0.11.4 for inspection.
Results logged to /home/glenn/.rvm/gems/ruby-1.9.3-p392/gems/therubyracer-0.11.4/ext/v8/gem_make.out
4

1 回答 1

0

我假设您在 Chromebook 上使用 Linux 发行版(直接或通过chroot)。这个对吗?

它正在寻找v8.h,因此您还需要安装 v8 开发包:它libv8-dev在 Debian/Ubuntu-devel上(以及 RedHat 和类似的东西)。

于 2013-05-16T11:04:41.910 回答