【问题标题】:Unable to install the gem therubyracer无法安装 gem therubyracer
【发布时间】:2012-03-25 16:08:53
【问题描述】:

在运行 bundle install 命令时,我遇到了以下错误:

安装带有本机扩展的 libv8 (3.3.10.4) Gem::Installer::ExtensionBuildError: 错误: 无法构建 gem native 扩展名。

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

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

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

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 install libv8 -v '3.3.10.4' 之前成功 捆绑。

环境:Ruby 1.9.2 Rails 3.2.1 Gem:1.8.17 宝石文件

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'

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

【问题讨论】:

标签: ruby-on-rails


【解决方案1】:

你做了gem install libv8 -v '3.3.10.4'

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

【讨论】:

  • 我已经尝试过了,但我仍然遇到同样的错误,它正在寻找 Python。
  • 基本上,我想将我的应用程序上传到 Heroku。但是 java 脚本没有在 Heroku 环境中编译所以我在 Gemfile 中添加了一些 gem,gem 'execjs' 和 gem 'therubyracer'。 execjs gem 安装正确,'therubyracer' gen 没有安装,出现上述错误。
  • 如果单独安装gem然后给'bundle install',上述问题就解决了。
  • 是的,bundle 现在将使用已安装的 gem。
猜你喜欢
  • 2013-11-10
  • 1970-01-01
  • 2021-04-24
  • 1970-01-01
  • 2020-04-11
  • 1970-01-01
  • 2013-11-15
  • 1970-01-01
  • 2012-03-26
相关资源
最近更新 更多