简体   繁体   English

安装therubyracer(0.10.1)时发生错误

[英]An error occurred while installing therubyracer (0.10.1)

Hi i got this error while bundle install... 嗨,我在安装捆绑软件时收到此错误...

Installing therubyracer (0.10.1) with native extensions 
Gem::Installer::ExtensionBuildError: ERROR: Failed to build gem native extension.

        /home/rajendran/.rvm/rubies/ruby-1.9.3-p374/bin/ruby 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
    --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/rajendran/.rvm/rubies/ruby-1.9.3-p374/bin/ruby
extconf.rb:15:in `<main>': undefined method `include_path' for Libv8:Module (NoMethodError)


Gem files will remain installed in /home/rajendran/.rvm/gems/ruby-1.9.3-p374/gems/therubyracer-0.10.1 for inspection.
Results logged to /home/rajendran/.rvm/gems/ruby-1.9.3-p374/gems/therubyracer-0.10.1/ext/v8/gem_make.out
An error occurred while installing therubyracer (0.10.1), and Bundler cannot continue.
Make sure that `gem install therubyracer -v '0.10.1'` succeeds before bundling.

how can i resolve this..? 我该如何解决..?
Note: OS - Ubuntu 12.10 注意:作业系统-Ubuntu 12.10

You can try like the following: 您可以尝试如下操作:

$ gem uninstall libv8
$ gem install therubyracer

It makes working mine when i got the error. 当我得到错误时,它使我的工作正常。

PS you need to mention your OS PS您需要提及您的操作系统

Similar to @Sri, but a bit different, so paste it in not to forget it: os - xubuntu 12.10 与@Sri类似,但有所不同,因此请粘贴它,不要忘记它:os-xubuntu 12.10

  1. gem install therubyracer 宝石安装therubyracer
  2. gem uninstall libv8 gem卸载libv8
  3. gem uninstall therubyracer gem卸载therubyracer
  4. gem install therubyracer -v '0.9.9' version of this gem was crucial... gem install therubyracer -v'0.9.9'版本,这个gem至关重要。

sudo apt-get install g++ did the job ... sudo apt-get install g ++完成了这项工作...

hope it'll helps someone 希望对别人有帮助

another solution without reinstallation. 无需重新安装的另一种解决方案。 (in case other Rails applications use a different version) : (以防其他Rails应用程序使用其他版本):

1.list the installed gem versions: 1.列出已安装的gem版本:

$ gem list -l therubyracer    

*** LOCAL GEMS ***
therubyracer (0.12.0)

2.modify your Gemfile to use one of the installed gems: 2.修改您的Gemfile以使用已安装的gem之一:

# Gemfile
gem 'therubyracer', '0.12.0', platforms: :ruby

done. 完成。 now try 'bundle install' will give you a success notice. 现在尝试“捆绑安装”会给您成功通知。

声明:本站的技术帖子网页,遵循CC BY-SA 4.0协议,如果您需要转载,请注明本站网址或者原文地址。任何问题请咨询:yoyou2525@163.com.

 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM