安装rubygems时出错(不推荐使用DL)

时间:2015-05-22 10:51:43

标签: ruby-on-rails gem therubyracer libv8

您好我要安装:

  • gem'therubyracer','〜> 0.12.2'
  • gem'libv8','〜> 3.16.14.7'

在我的应用程序ruby(在Windows上)

当我执行命令

bundle install

the terminal show me this error:
C:\Sites\bootstrap>bundle install
DL is deprecated, please use Fiddle
Fetching gem metadata from https://rubygems.org/............
Fetching additional metadata from https://rubygems.org/..
Resolving dependencies...
Using rake 10.4.2
Using i18n 0.7.0
Using json 1.8.2
Using minitest 5.6.1
Using thread_safe 0.3.5
Using tzinfo 1.2.2
Using activesupport 4.1.8
Using builder 3.2.2
Using erubis 2.7.0
Using actionview 4.1.8
Using rack 1.5.3
Using rack-test 0.6.3
Using actionpack 4.1.8
Using mime-types 2.5
Using mail 2.6.3
Using actionmailer 4.1.8
Using activemodel 4.1.8
Using arel 5.0.1.20140414130214
Using activerecord 4.1.8
Using bundler 1.7.7
Using coffee-script-source 1.9.1.1
Using execjs 2.5.2
Using coffee-script 2.4.1
Using thor 0.19.1
Using railties 4.1.8
Using coffee-rails 4.0.1
Using commonjs 0.2.7
Using hike 1.2.3
Using multi_json 1.11.0
Using jbuilder 2.2.16
Using jquery-rails 3.1.2
Using less 2.6.0
Using tilt 1.4.1
Using sprockets 2.12.3
Using less-rails 2.7.0

Gem::Ext::BuildError: ERROR: Failed to build gem native extension.

    C:/RailsInstaller/Ruby2.1.0/bin/ruby.exe -r ./siteconf20150522-5296-1qzvvgb.
rb extconf.rb
creating Makefile
Impossibile trovare il percorso specificato.
Impossibile trovare il percorso specificato.
Impossibile trovare il percorso specificato.
C:/RailsInstaller/Ruby2.1.0/lib/ruby/gems/2.1.0/gems/libv8-3.16.14.7/ext/libv8/b
uilder.rb:68:in `setup_python!': libv8 requires python 2 to be installed in orde
r to build, but it is currently not available (RuntimeError)
        from C:/RailsInstaller/Ruby2.1.0/lib/ruby/gems/2.1.0/gems/libv8-3.16.14.
7/ext/libv8/builder.rb:52:in `block in build_libv8!'
        from C:/RailsInstaller/Ruby2.1.0/lib/ruby/gems/2.1.0/gems/libv8-3.16.14.
7/ext/libv8/builder.rb:49:in `chdir'
        from C:/RailsInstaller/Ruby2.1.0/lib/ruby/gems/2.1.0/gems/libv8-3.16.14.
7/ext/libv8/builder.rb:49:in `build_libv8!'
        from C:/RailsInstaller/Ruby2.1.0/lib/ruby/gems/2.1.0/gems/libv8-3.16.14.
7/ext/libv8/location.rb:24:in `install!'
        from extconf.rb:7:in `<main>'

extconf failed, exit code 1

Gem files will remain installed in C:/RailsInstaller/Ruby2.1.0/lib/ruby/gems/2.1
.0/gems/libv8-3.16.14.7 for inspection.
Results logged to C:/RailsInstaller/Ruby2.1.0/lib/ruby/gems/2.1.0/extensions/x86
-mingw32/2.1.0/libv8-3.16.14.7/gem_make.out
An error occurred while installing libv8 (3.16.14.7), and Bundler cannot
continue.
Make sure that `gem install libv8 -v '3.16.14.7'` succeeds before bundling.

当我尝试从终端执行gem命令安装libv8时出现相同的错误:

gem install libv8 -v '3.16.14.7'

我该如何解决这个问题?

2 个答案:

答案 0 :(得分:0)

记录答案内容。

{{1}}

您需要先安装python 2才能使用此gem。

答案 1 :(得分:0)

阻力最小的路径是安装node.js并将gemfile修改为此。

gem 'therubyracer', platform: :ruby

然后它应该安装得很好。这就是我的工作方式,我们使用Windows在我们的环境中进行开发。