Windows 7 - `require':无法加载此类文件 - nokogiri / nokogiri(LoadError)

时间:2015-10-20 15:10:56

标签: ruby windows rubygems

> C:\Ruby22-x64\bin\ruby.exe -v
ruby 2.2.2p95 (2015-04-13 revision 50295) [x64-mingw32]

> rawler
C:/Ruby22-x64/lib/ruby/2.2.0/rubygems/core_ext/kernel_require.rb:54:in `require': cannot load such file -- nokogiri/nokogiri (LoadError)
        from C:/Ruby22-x64/lib/ruby/2.2.0/rubygems/core_ext/kernel_require.rb:54:in `require'
        from C:/Ruby22-x64/lib/ruby/gems/2.2.0/gems/nokogiri-1.6.6.2-x64-mingw32/lib/nokogiri.rb:29:in `rescue in <top (required)>'
        from C:/Ruby22-x64/lib/ruby/gems/2.2.0/gems/nokogiri-1.6.6.2-x64-mingw32/lib/nokogiri.rb:25:in `<top (required)>'
        from C:/Ruby22-x64/lib/ruby/2.2.0/rubygems/core_ext/kernel_require.rb:128:in `require'
        from C:/Ruby22-x64/lib/ruby/2.2.0/rubygems/core_ext/kernel_require.rb:128:in `rescue in require'
        from C:/Ruby22-x64/lib/ruby/2.2.0/rubygems/core_ext/kernel_require.rb:39:in `require'
        from C:/Ruby22-x64/lib/ruby/gems/2.2.0/gems/rawler-0.1.8/lib/rawler.rb:3:in `<top (required)>'
        from C:/Ruby22-x64/lib/ruby/2.2.0/rubygems/core_ext/kernel_require.rb:54:in `require'
        from C:/Ruby22-x64/lib/ruby/2.2.0/rubygems/core_ext/kernel_require.rb:54:in `require'
        from C:/Ruby22-x64/lib/ruby/gems/2.2.0/gems/rawler-0.1.8/bin/rawler:3:in `<top (required)>'
        from C:/Ruby22-x64/bin/rawler:23:in `load'
        from C:/Ruby22-x64/bin/rawler:23:in `<main>'

我是如何在Windows 7上解决此问题的?

宝石装好了。它似乎正在运行它的问题。我使用的是Powershell,但如果它出现问题,可能就会抛弃它。虽然说过我刚刚测试过,但我使用git bash也遇到了同样的问题。

====更新

gem environment

RubyGems Environment:
  - RUBYGEMS VERSION: 2.4.5
  - RUBY VERSION: 2.2.2 (2015-04-13 patchlevel 95) [x64-mingw32]
  - INSTALLATION DIRECTORY: C:/Ruby22-x64/lib/ruby/gems/2.2.0
  - RUBY EXECUTABLE: C:/Ruby22-x64/bin/ruby.exe
  - EXECUTABLE DIRECTORY: C:/Ruby22-x64/bin
  - SPEC CACHE DIRECTORY: H:/.gem/specs
  - SYSTEM CONFIGURATION DIRECTORY: C:/ProgramData
  - RUBYGEMS PLATFORMS:
    - ruby
    - x64-mingw32
  - GEM PATHS:
     - C:/Ruby22-x64/lib/ruby/gems/2.2.0
     - H:/.gem/ruby/2.2.0
  - GEM CONFIGURATION:
     - :update_sources => true
     - :verbose => true
     - :backtrace => false
     - :bulk_threshold => 1000
     - :sources => ["http://rubygems.org/"]
  - REMOTE SOURCES:
     - http://rubygems.org/
  - SHELL PATH:
     - %SystemRoot%\system32\WindowsPowerShell\v1.0\
     - C:\Ruby22-x64\bin
     - C:\Program Files (x86)\Git\cmd
     - C:\windows\system32
     - C:\windows
     - C:\windows\System32\WindowsPowerShell\v1.0\

(删除不相关的输出)

0 个答案:

没有答案