Attempting to install libv8, “failed to build gem native extension”

谁说我不能喝 提交于 2019-12-20 12:22:08

问题


I am using W7 64bit. Simply put, when I enter:

C:\Sites>gem install libv8

I get this result:

Temporarily enhancing PATH to include DevKit...
Building native extensions.  This could take a while...
ERROR:  Error installing libv8:
ERROR: Failed to build gem native extension.

    C:/RailsInstaller/Ruby1.9.3/bin/ruby.exe extconf.rb
creating Makefile
which: no gmake in ("my PATH is here, and as far as I know it should include everything I need")
/usr/bin/env: python: No such file or directory
C:\RailsInstaller\DevKit\bin\make.EXE: *** [out/Makefile.ia32] Error 127
Using compiler: C:\RailsInstaller\DevKit\mingw\bin\g++.EXE
GYP_GENERATORS=make \
    build/gyp/gyp --generator-output="out" build/all.gyp \
                  -Ibuild/standalone.gypi --depth=. \
                  -Dv8_target_arch=ia32 \
                  -S.ia32 -Dhost_arch=ia32


Gem files will remain installed in C:/RailsInstaller/Ruby1.9.3/lib/ruby/gems/1.9
.1/gems/libv8-3.11.8.3 for inspection.
Results logged to C:/RailsInstaller/Ruby1.9.3/lib/ruby/gems/1.9.1/gems/libv8-3.1
1.8.3/ext/libv8/gem_make.out

Uninstalling and reinstalling does not work.

I'm trying to install libv8 because it's a dependency for twitter-bootstrap-rails.

EDIT: As I said, I'm on Windows, and I'm realizing now that there's a filepath listed in this error as /usr/bin/env. So that's weird.


回答1:


The solution is to install version .0

gem install libv8 --version 3.11.8.0

until this is fixed, as I experienced this, too




回答2:


I had this problem, and @xiy above led me to the answer. Had to change

gem 'therubyracer'

to

gem 'therubyracer', :platforms => :ruby

as Windows does not need or like that gem.




回答3:


I had the same windows problem that you described with:

gem 'twitter-bootstrap-rails'

When I switched this the version from github:

gem 'twitter-bootstrap-rails', :github => 'seyhunak/twitter-bootstrap-rails'

No problem. Give that a shot.



来源:https://stackoverflow.com/questions/11386580/attempting-to-install-libv8-failed-to-build-gem-native-extension

易学教程内所有资源均来自网络或用户发布的内容,如有违反法律规定的内容欢迎反馈
该文章没有解决你所遇到的问题?点击提问,说说你的问题,让更多的人一起探讨吧!