ruby – hitimes在Windows 8.1上运行jekyll服务时需要输入错误

前端之家收集整理的这篇文章主要介绍了ruby – hitimes在Windows 8.1上运行jekyll服务时需要输入错误前端之家小编觉得挺不错的,现在分享给大家,也给大家做个参考。
我正在尝试在运行 Windows 8.1的本地计算机上运行jekyll,我已经安装了 Ruby并且正在运行但是每次运行jekyll serve命令时我都会收到错误消息:
C:/Ruby22/lib/ruby/2.2.0/rubygems/core_ext/kernel_require.rb:54:in `require': cannot load such file -- hitimes/hitimes (LoadError)

我已经尝试通过gem install hitimes手动安装hitimes并且它工作正常,如果我打开irb我可以要求’hitimes’没有问题它只是似乎不适用于jekyll.

我的宝石环境是:

RubyGems Environment:
  - RUBYGEMS VERSION: 2.4.5
  - RUBY VERSION: 2.2.1 (2015-02-26 patchlevel 85) [i386-mingw32]
  - INSTALLATION DIRECTORY: C:/Ruby22/lib/ruby/gems/2.2.0
  - RUBY EXECUTABLE: C:/Ruby22/bin/ruby.exe
  - EXECUTABLE DIRECTORY: C:/Ruby22/bin
  - SPEC CACHE DIRECTORY: C:/Users/adam.laycock/.gem/specs
  - SYSTEM CONFIGURATION DIRECTORY: C:/ProgramData
  - RUBYGEMS PLATFORMS:
    - ruby
    - x86-mingw32
  - GEM PATHS:
    - C:/Ruby22/lib/ruby/gems/2.2.0
    - C:/Users/adam.laycock/.gem/ruby/2.2.0
  - GEM CONFIGURATION:
    - :update_sources => true
    - :verbose => true
    - :backtrace => false
    - :bulk_threshold => 1000
  - REMOTE SOURCES:
    - https://rubygems.org/
  - SHELL PATH:
    - C:\RubyDevKit\bin
    - C:\RubyDevKit\mingw\bin
    - C:\windows\system32
    - C:\windows
    - C:\windows\System32\Wbem
    - C:\windows\System32\WindowsPowerShell\v1.0\
    - C:\Program Files\nodejs\
    - C:\Users\adam.laycock\AppData\Roaming\npm
    - C:\Users\adam.laycock\AppData\Local\GitHub\PortableGit_c2ba306e536fdf878271f7fe636a147ff37326ad\cmd
    - C:\Users\adam.laycock\AppData\Local\GitHub\PortableGit_c2ba306e536fdf878271f7fe636a147ff37326ad\bin
    - C:\Users\adam.laycock\AppData\Local\GitHub\PortableGit_c2ba306e536fdf878271f7fe636a147ff37326ad\mingw\bin
    - C:\Users\adam.laycock\AppData\Local\Apps\2.0\O3WGNDW8.VMM\C2M3657K.JNR\gith..tion_317444273a93ac29_0002.000a_7c768ac46c12be54
    - C:\windows\Microsoft.NET\Framework\v4.0.30319
    - C:\Ruby22\Bin

jekyll -v返回2.5.3

解决方法

它可能与Ruby 2.2中的一些破坏ABI更改有关,而hitimes-1.2.2-x86-mingw32不包含Ruby 2.2的胖二进制文件.

解决方法是卸载并重新安装它,并在安装时使用–platform ruby​​.

这样做:

gem uni hitimes

**Remove ALL versions**

gem ins hitimes -v 1.2.1 --platform ruby

这将重新编译与Ruby 2.2兼容的hitimes.

编辑:作为copiousfreetime mentioned in the comments,需要RubyInstaller DevKit来编译二进制rubygems

Hitimes的1.2.3及更高版本应包含Ruby 2.2.X版本的胖二进制文件. Thanks copiousfreetime

猜你在找的Ruby相关文章