在Windows 8.1上运行jekyll serve时,hitimes需要输入错误

Arc*_*ath 8 ruby windows

我正在尝试在运行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)
Run Code Online (Sandbox Code Playgroud)

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

gem environment是:

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
Run Code Online (Sandbox Code Playgroud)

jekyll -v 返回2.5.3

Azo*_*olo 21

它可能与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
Run Code Online (Sandbox Code Playgroud)

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

编辑:作为评论中提到copiousfreetime,RubyInstaller DevKit需要编译二进制rubygems

版本1.2.3及更高版本hitimes应包含Ruby 2.2.X发行版的胖二进制文件.谢谢丰富的自由时间

  • 对我而言,它适用于`gem ins hitimes -v 1.2.2 --platform ruby​​` (4认同)
  • 这只适用于安装了windows ruby​​ DevKit的情况.Hitimes使用C扩展并需要编译器来构建源代码. (2认同)