本文介绍了无法安装 gem therubyracer的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

在运行 bundle install 命令时,遇到如下错误:

While running the bundle install command, I encountered the following error:

使用本机扩展安装 libv8 (3.3.10.4)Gem::Installer::ExtensionBuildError: 错误:无法构建 gem 本机扩展名.

    D:/RailsInstaller/Ruby1.9.2/bin/ruby.exe extconf.rb

* extconf.rb failed * 由于某种原因无法创建 Makefile,可能缺少必要的库和/或头文件.查看有关更多详细信息,请查看 mkmf.log 文件.您可能需要配置选项.

* 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.

提供的配置选项:--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=D:/RailsInstaller/Ruby1.9.2/bin/ruby 正在检查 Python...无法构建 libv8:找不到 Python!

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=D:/RailsInstaller/Ruby1.9.2/bin/ruby Checking for Python...Unable to build libv8: Python not found!

Gem 文件将保持安装在D:/RailsInstaller/Ruby1.9.2/lib/ruby/gems/1.9 .1/gems/libv8-3.3.10.4供检查.结果记录到D:/RailsInstaller/Ruby1.9.2/lib/ruby/gems/1.9.1/gems/libv8-3.3.10.4/ext/libv8/gem_make.out 安装libv8时出现错误(3.3.10.4),Bundler 无法继续.

Gem files will remain installed in D:/RailsInstaller/Ruby1.9.2/lib/ruby/gems/1.9 .1/gems/libv8-3.3.10.4 for inspection. Results logged to D:/RailsInstaller/Ruby1.9.2/lib/ruby/gems/1.9.1/gems/libv8-3.3 .10.4/ext/libv8/gem_make.out An error occured while installing libv8 (3.3.10.4), and Bundler cannot continue.

确保 gem install libv8 -v '3.3.10.4' 之前成功捆绑.

Make sure that gem install libv8 -v '3.3.10.4' succeeds before bundling.

环境:Ruby 1.9.2 Rails 3.2.1 Gem:1.8.17Gemfile

Environment: Ruby 1.9.2 Rails 3.2.1 Gem : 1.8.17Gemfile

source 'https://rubygems.org'

    gem 'rails', '3.2.1'

    gem 'sqlite3'

    gem "heroku"

    group :production do
      gem 'pg'
    end

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


    group :assets do
      gem 'sass-rails',   '~> 3.2.3'
      gem 'coffee-rails', '~> 3.2.1'
      gem 'uglifier', '>= 1.0.3'
    end

    gem 'jquery-rails'

谁能告诉我为什么我会看到这个错误,以及如何解决它?

Can anybody tell me why I am seeing this error, and how to fix it?

推荐答案

你做了 gem install libv8 -v '3.3.10.4'

您也可以尝试安装python.对于 Mac,请参见 http://www.python.org/getit/mac/

You could also try installing python. For mac see http://www.python.org/getit/mac/

这篇关于无法安装 gem therubyracer的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持!

09-17 12:29