【问题标题】:An error occurred while installing therubyracer (0.10.1)安装 ruby​​racer (0.10.1) 时出错
【发布时间】:2013-02-15 11:03:04
【问题描述】:

您好,我在安装包时遇到此错误...

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.

我该如何解决这个..?
注意:操作系统 - Ubuntu 12.10

【问题讨论】:

    标签: ruby-on-rails ruby-on-rails-3 rubygems gem


    【解决方案1】:

    你可以尝试如下:

    $ gem uninstall libv8
    $ gem install therubyracer
    

    当我遇到错误时,它使我的工作正常。

    P.S你需要提及你的操作系统

    【讨论】:

    • 为我工作。谢谢
    • 您可以在 Gemfile 中注释 'trerubyracer' 字符串并进行捆绑安装。
    • 在 macOS Mojave 10.14.3 上为我工作。谢谢!
    【解决方案2】:

    与@Sri 类似,但有点不同,所以粘贴它不要忘记它: 操作系统-xubuntu 12.10

    1. gem install therubyracer
    2. gem 卸载 libv8
    3. gem 卸载 therubyracer
    4. gem install therubyracer -v '0.9.9' 这个 gem 的版本很重要...

    【讨论】:

      【解决方案3】:

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

      希望对某人有所帮助

      【讨论】:

      • CentOS 用户:yum install gcc-c++。这对我有用。
      【解决方案4】:

      无需重新安装的另一种解决方案。 (如果其他 Rails 应用程序使用不同的版本):

      1.列出已安装的gem版本:

      $ gem list -l therubyracer    
      
      *** LOCAL GEMS ***
      therubyracer (0.12.0)
      

      2.修改您的 Gemfile 以使用已安装的 gem 之一:

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

      完成。现在尝试“捆绑安装”会给你一个成功通知。

      【讨论】:

        猜你喜欢
        • 1970-01-01
        • 2017-06-24
        • 2013-03-27
        • 2015-10-04
        • 2014-10-02
        • 2022-10-05
        • 2014-01-20
        • 2023-03-29
        相关资源
        最近更新 更多