无法加载机械化宝石,不支持Process#getrlimit?

时间:2018-06-18 17:04:57

标签: ruby jruby mechanize

我正在尝试在ruby中使用机械化,但我无法使其工作。我目前正在执行的是:

require 'rubygems'
require 'mechanize'

我收到此错误消息:

C:\jruby-9.1.13.0\bin\jruby.exe -e $stdout.sync=true;$stderr.sync=true;load($0=ARGV.shift) 
C:/Users/lothj1/RubymineProjects/reportscript/main.rb
C:/jruby-9.1.13.0/lib/ruby/gems/shared/gems/net-http-persistent 3.0.0/lib/net/http/persistent.rb:205: warning: Process#getrlimit not supported on this platform
NoMethodError: undefined method `first' for 9223372036854775807:Fixnum
  <class:Persistent> at C:/jruby-9.1.13.0/lib/ruby/gems/shared/gems/net-http-persistent-3.0.0/lib/net/http/persistent.rb:205
          <main> at C:/jruby-9.1.13.0/lib/ruby/gems/shared/gems/net-http-persistent-3.0.0/lib/net/http/persistent.rb:190
         require at org/jruby/RubyKernel.java:955
          <main> at C:/jruby-9.1.13.0/lib/ruby/gems/shared/gems/mechanize-2.7.6/lib/mechanize.rb:1
         require at org/jruby/RubyKernel.java:955
          <main> at C:/jruby-9.1.13.0/lib/ruby/gems/shared/gems/mechanize-2.7.6/lib/mechanize.rb:6
            load at org/jruby/RubyKernel.java:973
          <main> at -e:1

Process finished with exit code 1

通过跟踪错误,我认为net-http-persistent似乎存在问题。它正在使用'persistent.rb&#39;

中的这一行
DEFAULT_POOL_SIZE = Process.getrlimit(Process::RLIMIT_NOFILE).first / 4

有谁知道我能做什么?我还没能在网上找到有关此错误的任何信息。谢谢!

0 个答案:

没有答案