Nokogiri 在 Windows 上与 Ruby 2.1

Nokogiri on Windows with Ruby 2.1

当我尝试 运行 我的应用程序时,我收到 nokogiri 错误(完整跟踪如下)。我知道 nokogiri 在 ruby 2.2 上不支持 Windows,但我使用的是 2.1.5,所以看起来应该不是问题。当我执行 gem install -v 1.6 时 gem 安装完美,所以我不确定发生了什么。

完整错误跟踪:

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>'

我建议升级到最新版本 nokogiri 1.6.6.2。使用 ruby 2.1.5.

在 windows 上工作得很好