Nokogiri on Windows with Ruby 2.1

481 views Asked by At

When I try to run my application I get a nokogiri error (full trace below). I understand that nokogiri doesn't support Windows on ruby 2.2, but I'm using 2.1.5 so it seems like it shouldn't be a problem. The gem installs perfectly when I do gem install -v 1.6 so I'm not sure what's happening.

Full error trace:

PS C:\Users\Ben\Documents\RubymineProjects\Hes>  bundle exec rails server
DL is deprecated, please use Fiddle
C:/RailsInstaller/Ruby2.1.0/lib/ruby/gems/2.1.0/gems/nokogiri-1.6.0-x86-mingw32/lib/nokogiri/nokogiri.rb:1:in `require':
 cannot load such file -- nokogiri/2.1/nokogiri (LoadError)
        from C:/RailsInstaller/Ruby2.1.0/lib/ruby/gems/2.1.0/gems/nokogiri-1.6.0-x86-mingw32/lib/nokogiri/nokogiri.rb:1:
in `<top (required)>'
        from C:/RailsInstaller/Ruby2.1.0/lib/ruby/gems/2.1.0/gems/nokogiri-1.6.0-x86-mingw32/lib/nokogiri.rb:28:in `requ
ire'
        from C:/RailsInstaller/Ruby2.1.0/lib/ruby/gems/2.1.0/gems/nokogiri-1.6.0-x86-mingw32/lib/nokogiri.rb:28:in `<top
 (required)>'
        from C:/RailsInstaller/Ruby2.1.0/lib/ruby/gems/2.1.0/bundler/gems/hqmf2js-71d9c742d65f/lib/hqmf2js.rb:11:in `req
uire'
        from C:/RailsInstaller/Ruby2.1.0/lib/ruby/gems/2.1.0/bundler/gems/hqmf2js-71d9c742d65f/lib/hqmf2js.rb:11:in `<to
p (required)>'
        from C:/RailsInstaller/Ruby2.1.0/lib/ruby/gems/2.1.0/gems/bundler-1.7.7/lib/bundler/runtime.rb:76:in `require'
        from C:/RailsInstaller/Ruby2.1.0/lib/ruby/gems/2.1.0/gems/bundler-1.7.7/lib/bundler/runtime.rb:76:in `block (2 l
evels) in require'
        from C:/RailsInstaller/Ruby2.1.0/lib/ruby/gems/2.1.0/gems/bundler-1.7.7/lib/bundler/runtime.rb:72:in `each'
        from C:/RailsInstaller/Ruby2.1.0/lib/ruby/gems/2.1.0/gems/bundler-1.7.7/lib/bundler/runtime.rb:72:in `block in r
equire'
        from C:/RailsInstaller/Ruby2.1.0/lib/ruby/gems/2.1.0/gems/bundler-1.7.7/lib/bundler/runtime.rb:61:in `each'
        from C:/RailsInstaller/Ruby2.1.0/lib/ruby/gems/2.1.0/gems/bundler-1.7.7/lib/bundler/runtime.rb:61:in `require'
        from C:/RailsInstaller/Ruby2.1.0/lib/ruby/gems/2.1.0/gems/bundler-1.7.7/lib/bundler.rb:133:in `require'
        from C:/Users/Ben/Documents/RubymineProjects/Health-eFilings/config/application.rb:12:in `<top (required)>'
        from C:/RailsInstaller/Ruby2.1.0/lib/ruby/gems/2.1.0/gems/railties-4.1.4/lib/rails/commands/commands_tasks.rb:79
:in `require'
        from C:/RailsInstaller/Ruby2.1.0/lib/ruby/gems/2.1.0/gems/railties-4.1.4/lib/rails/commands/commands_tasks.rb:79
:in `block in server'
        from C:/RailsInstaller/Ruby2.1.0/lib/ruby/gems/2.1.0/gems/railties-4.1.4/lib/rails/commands/commands_tasks.rb:76
:in `tap'
        from C:/RailsInstaller/Ruby2.1.0/lib/ruby/gems/2.1.0/gems/railties-4.1.4/lib/rails/commands/commands_tasks.rb:76
:in `server'
        from C:/RailsInstaller/Ruby2.1.0/lib/ruby/gems/2.1.0/gems/railties-4.1.4/lib/rails/commands/commands_tasks.rb:40
:in `run_command!'
        from C:/RailsInstaller/Ruby2.1.0/lib/ruby/gems/2.1.0/gems/railties-4.1.4/lib/rails/commands.rb:17:in `<top (requ
ired)>'
        from script/rails:6:in `require'
        from script/rails:6:in `<main>'
1

There are 1 answers

1
nathanvda On BEST ANSWER

I would propose upgrading to nokogiri 1.6.6.2, the latest version. It works just fine on windows using ruby 2.1.5.