3

FreeBSd OS を使用しています。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 

含めました

gem 'therubyracer'
gem 'libv8', '3.3.10.4'

gemファイルで..

4

1 に答える 1

2

これは、Ruby 1.8.7 で発生する可能性があり、1.9.x のように Ruby gem が自動的に含まれません。ここの github に更新があります: https://github.com/fractaloop/libv8/blob/master/ext/libv8/extconf.rb

しかし、これは現時点で公開されている宝石にはないようです。次のようにインストールするのと同じくらい簡単です。

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

しかし、ソースを見ると、gem のバージョンと v8 ライブラリのバージョンが動的に関連付けられており、試してみると、バージョン 0.0.4 であると言って失敗しました。私は別のOSを使用していますが、試してみて、それが機能するかどうかを確認してください。

于 2012-03-01T22:20:56.863 に答える