2012-03-08 145 views
1

在運行捆綁安裝的命令,我遇到了以下錯誤寶石:無法安裝therubyracer

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

D:/RailsInstaller/Ruby1.9.2/bin/ruby.exe 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 --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 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.

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

環境:紅寶石1.9.2的Rails 3.2.1寶石:1.8.17 的Gemfile

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' 

有人可以告訴我爲什麼我看到這個錯誤,以及如何解決它?

+0

可能重複[therubyracer寶石在Windows](http://stackoverflow.com/questions/6356450/therubyracer-gem-on-windows) – 2014-06-18 07:10:05

回答

2

你做gem install libv8 -v '3.3.10.4'

您也可以嘗試安裝Python。對於mac看http://www.python.org/getit/mac/

+0

我試過這個,但我得到同樣的錯誤,它尋找Python。 – 2012-03-09 02:28:04

+0

基本上,我想將我的應用程序上傳到Heroku。但是,Java腳本並未在Heroku環境中編譯所以,我已經爲Gemfile,gem'execjs'和gem'therubyracer'添加了一些寶石。 execjs gem安裝正確,'therubyracer'gen未安裝,出現上述錯誤。 – 2012-03-09 03:06:39

+0

如果寶石單獨安裝,然後給'捆綁安裝',上述問題得到解決。 – maniempire 2013-09-05 07:14:37