无法安装therubyracer宝石

4

我单独安装了libv8 gem,没有遇到任何问题,但是当我尝试安装therubyracer gem时,出现以下错误:

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

        /usr/bin/ruby extconf.rb
checking for main() in -lpthread... yes
Warning! Unable to load libv8 ~> 3.16.14.
*** 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}/
    --with-make-prog
    --without-make-prog
    --srcdir=.
    --curdir
    --ruby=/usr/bin/ruby
    --with-pthreadlib
    --without-pthreadlib
    --enable-debug
    --disable-debug
extconf.rb:32:in `<main>': undefined method `configure_makefile' for Libv8:Module (NoMethodError)


Gem files will remain installed in /home/thecodehitman/ruby/gems/gems/therubyracer-0.12.1 for inspection.
Results logged to /home/thecodehitman/ruby/gems/gems/therubyracer-0.12.1/ext/v8/gem_make.out

不确定该怎么做。

与IT技术无关。
1个回答

1

试试这个:

$ sudo gem install therubyracer --platform ruby

请尝试使用sudo或不使用sudo。

如果这是一个Ruby on Rails应用程序,请包含以下行:

gem 'therubyracer', :platform=>:ruby

在 Gemfile 内部。

很遗憾,由于这是一个共享服务器,我没有sudo权限,但如果没有sudo,它就无法工作。 - codehitman
这是一个 Ruby on Rails 应用程序吗? - Marco Damaceno
请尝试删除Gemfile.lock,然后使用--no-deployment选项卸载Ruby。 - Bruce Li

网页内容由stack overflow 提供, 点击上面的
可以查看英文原文,
原文链接