我正在通过gem安装Jekyll。按照此说明https://learn.cloudcannon.com/jekyll/install-jekyll-on-windows/安装Ruby并在cmd中键入“ gem install jekyll”后,出现以下错误:
C:\Windows\system32>gem install jekyll
Traceback (most recent call last):
15: from <internal:gem_prelude>:2:in `<internal:gem_prelude>'
14: from <internal:gem_prelude>:2:in `require'
13: from C:/tools/ruby25/lib/ruby/2.5.0/rubygems.rb:1388:in `<top (required)>'
12: from C:/tools/ruby25/lib/ruby/2.5.0/rubygems.rb:1388:in `require'
11: from C:/tools/ruby25/lib/ruby/2.5.0/rubygems/defaults/operating_system.rb:3:in `<top (required)>'
10: from C:/tools/ruby25/lib/ruby/site_ruby/2.5.0/ruby_installer/runtime/singleton.rb:27:in `enable_dll_search_paths'
9: from C:/tools/ruby25/lib/ruby/site_ruby/2.5.0/ruby_installer/runtime/msys2_installation.rb:96:in `enable_dll_search_paths'
8: from C:/tools/ruby25/lib/ruby/site_ruby/2.5.0/ruby_installer/runtime/msys2_installation.rb:86:in `mingw_bin_path'
7: from C:/tools/ruby25/lib/ruby/site_ruby/2.5.0/ruby_installer/runtime/msys2_installation.rb:73:in `msys_path'
6: from C:/tools/ruby25/lib/ruby/site_ruby/2.5.0/ruby_installer/runtime/msys2_installation.rb:48:in `iterate_msys_paths'
5: from C:/tools/ruby25/lib/ruby/2.5.0/win32/registry.rb:542:in `open'
4: from C:/tools/ruby25/lib/ruby/2.5.0/win32/registry.rb:435:in `open'
3: from C:/tools/ruby25/lib/ruby/site_ruby/2.5.0/ruby_installer/runtime/msys2_installation.rb:49:in `block in iterate_msys_paths'
2: from C:/tools/ruby25/lib/ruby/2.5.0/win32/registry.rb:611:in `each_key'
1: from C:/tools/ruby25/lib/ruby/2.5.0/win32/registry.rb:910:in `export_string'
C:/tools/ruby25/lib/ruby/2.5.0/win32/registry.rb:910:in `encode': U+7F51 to IBM437 in conversion from UTF-16LE to UTF-8 to IBM437 (Encoding::UndefinedConversionError)
我遵循的步骤如下:
@powershell -NoProfile -ExecutionPolicy Bypass -Command "iex ((new-object net.webclient).DownloadString('https://chocolatey.org/install.ps1'))" && SET PATH=%PATH%;%ALLUSERSPROFILE%\chocolatey\bin
choco install ruby -y
gem install jekyll