【问题标题】:Nokogiri on Windows with Ruby 2.1带有 Ruby 2.1 的 Windows 上的 Nokogiri
【发布时间】:2015-09-02 22:36:36
【问题描述】:

当我尝试运行我的应用程序时,我得到一个 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>'

【问题讨论】:

    标签: ruby-on-rails ruby windows nokogiri ruby-2.1


    【解决方案1】:

    我建议升级到最新版本 nokogiri 1.6.6.2。它在使用 ruby​​ 2.1.5 的 Windows 上运行良好。

    【讨论】:

    • 如果可行,那么该版本的胖二进制文件可能是在 Ruby 2.1 发布之前编译的。
    猜你喜欢
    • 2013-06-05
    • 2023-04-09
    • 1970-01-01
    • 2014-12-18
    • 2015-02-21
    • 1970-01-01
    • 2018-01-04
    • 2014-01-28
    • 1970-01-01
    相关资源
    最近更新 更多