簡體   English   中英

安裝rubygems時出錯(不建議使用DL)

[英]Error installing rubygems (DL is deprecated)

您好我想安裝:

  • 寶石'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'

我該如何解決這個問題?

記錄內容答案。

Failed to build gem native extension.
....
libv8 requires python 2 to be installed in order to build, but it is currently not available (RuntimeError)

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

阻力最小的路徑是安裝node.js並將您的gemfile修改為此。

gem 'therubyracer', platform: :ruby

然后就可以安裝了。 我就是這樣做的,我們使用Windows在我們的環境中進行開發。

暫無
暫無

聲明:本站的技術帖子網頁,遵循CC BY-SA 4.0協議,如果您需要轉載,請注明本站網址或者原文地址。任何問題請咨詢:yoyou2525@163.com.

 
粵ICP備18138465號  © 2020-2024 STACKOOM.COM