Nokogiri not working on Windows 7 - Load Error

15 views
Skip to first unread message

Daniel Mortensen

unread,
Jul 27, 2017, 5:13:36 PM7/27/17
to nokogiri-talk
I was able to successfully install the Nokogiri gem on my Windows 7 machine. Now, running a script that I have been able to run on my Mac OS machine successfully, I am getting an error as follows:

C:\Users\daniel\Documents\GitHub\field_desc_uploader>.\desc.rb
C
:/Ruby22/lib/ruby/site_ruby/2.2.0/rubygems/core_ext/kernel_require.rb:55:in `re
quire': cannot load such file -- nokogiri/nokogiri (LoadError)
        from C:/Ruby22/lib/ruby/site_ruby/2.2.0/rubygems/core_ext/kernel_require
.rb:55:in `
require'
        from C:/Ruby22/lib/ruby/gems/2.2.0/gems/nokogiri-1.6.5-x86-mingw32/lib/n
okogiri.rb:29:in `rescue in <top (required)>'

       
from C:/Ruby22/lib/ruby/gems/2.2.0/gems/nokogiri-1.6.5-x86-mingw32/lib/n
okogiri
.rb:25:in `<top (required)>'
        from C:/Ruby22/lib/ruby/site_ruby/2.2.0/rubygems/core_ext/kernel_require
.rb:135:in `
require'
        from C:/Ruby22/lib/ruby/site_ruby/2.2.0/rubygems/core_ext/kernel_require
.rb:135:in `rescue in require'

       
from C:/Ruby22/lib/ruby/site_ruby/2.2.0/rubygems/core_ext/kernel_require
.rb:144:in `require'
        from C:/Users/daniel/Documents/GitHub/field_desc_uploader/desc
.rb:2:in `<main>'


Relevant part of script
#!/usr/bin/env ruby
require 'nokogiri'
require 'csv'
require 'pathname'
require 'pry'

I struggled with the installation of the gem on Windows but was eventually able to install the precompiled Windows gem as instructed on the Nokogiri site. You can see this when running gem list from the command line. 
bigdecimal (1.2.6)
bundler (1.15.3)
coderay (1.1.1)
io-console (0.4.3)
json (1.8.1)
method_source (0.8.2)
mini_portile (0.6.2)
mini_portile2 (2.2.0)
minitest (5.4.3)
nokogiri (1.6.5 x86-mingw32)
power_assert (0.2.2)
pry (0.10.4)
psych (2.0.8)
rake (10.4.2)
rdoc (4.2.0)
rubygems-update (2.6.12)
slop (3.6.0)
test-unit (3.0.8)

I tried posting this yesterday but it appears it wasn't approved. Any help would be appreciated. 

Lars Kanis

unread,
Jul 28, 2017, 1:15:53 AM7/28/17
to nokogi...@googlegroups.com
You must upgrade to nokogiri-1.6.7 or newer for ruby-2.2 on Windows.

Regards,
Lars

Daniel Mortensen

unread,
Jul 28, 2017, 11:23:18 AM7/28/17
to nokogiri-talk, la...@greiz-reinsdorf.de
This worked. Thanks!
Reply all
Reply to author
Forward
0 new messages