Rails 3 Mechanize - SocketError:getaddrinfo:主机或名称未知

发布于 2024-10-17 06:19:47 字数 1368 浏览 1 评论 0 原文

我正在使用 mechanize,但出现此错误。有人可以帮助我吗?

我已将元刷新设置为 true。

错误日志:

SocketError: getaddrinfo: Host or name not known
    form C:/Ruby192/lib/ruby/1.9.1/net/http.rb:644:in 'initiallize'
    form C:/Ruby192/lib/ruby/1.9.1/net/http.rb:644:in 'open'
    form C:/Ruby192/lib/ruby/1.9.1/net/http.rb:644:in 'block in connect'
    form C:/Ruby192/lib/ruby/1.9.1/timeout.rb:44:in 'timeout'
    form C:/Ruby192/lib/ruby/1.9.1/timeout.rb:87:in 'timeout'
    form C:/Ruby192/lib/ruby/1.9.1/net/http.rb:644:in 'connect'
    form C:/Ruby192/lib/ruby/1.9.1/net/http.rb:637:in 'do_start'
    form C:/Ruby192/lib/ruby/1.9.1/net/http.rb:632:in 'start'
    form C:/Ruby192/lib/ruby/gems/1.9.1/gems/mechanize-1.0.0/lib/mechanize.rb:527:in 'fetch_page'
    form C:/Ruby192/lib/ruby/gems/1.9.1/gems/mechanize-1.0.0/lib/mechanize.rb:591:in 'fetch_page'
    form C:/Ruby192/lib/ruby/gems/1.9.1/gems/mechanize-1.0.0/lib/mechanize.rb:464:in 'post_form'
    form C:/Ruby192/lib/ruby/gems/1.9.1/gems/mechanize-1.0.0/lib/mechanize.rb:370:in 'submit'
    form C:/Ruby192/lib/ruby/gems/1.9.1/gems/mechanize-1.0.0/lib/form.rb:141:in 'submit'

已更新 - 表单提交时出现错误消息 https://i.sstatic.net/Cuo9u.png

表单 https://i.sstatic.net/XlrIm.png

I am using mechanize and i get this error. Can someone please help me.

I have set meta refresh to true.

Error log:

SocketError: getaddrinfo: Host or name not known
    form C:/Ruby192/lib/ruby/1.9.1/net/http.rb:644:in 'initiallize'
    form C:/Ruby192/lib/ruby/1.9.1/net/http.rb:644:in 'open'
    form C:/Ruby192/lib/ruby/1.9.1/net/http.rb:644:in 'block in connect'
    form C:/Ruby192/lib/ruby/1.9.1/timeout.rb:44:in 'timeout'
    form C:/Ruby192/lib/ruby/1.9.1/timeout.rb:87:in 'timeout'
    form C:/Ruby192/lib/ruby/1.9.1/net/http.rb:644:in 'connect'
    form C:/Ruby192/lib/ruby/1.9.1/net/http.rb:637:in 'do_start'
    form C:/Ruby192/lib/ruby/1.9.1/net/http.rb:632:in 'start'
    form C:/Ruby192/lib/ruby/gems/1.9.1/gems/mechanize-1.0.0/lib/mechanize.rb:527:in 'fetch_page'
    form C:/Ruby192/lib/ruby/gems/1.9.1/gems/mechanize-1.0.0/lib/mechanize.rb:591:in 'fetch_page'
    form C:/Ruby192/lib/ruby/gems/1.9.1/gems/mechanize-1.0.0/lib/mechanize.rb:464:in 'post_form'
    form C:/Ruby192/lib/ruby/gems/1.9.1/gems/mechanize-1.0.0/lib/mechanize.rb:370:in 'submit'
    form C:/Ruby192/lib/ruby/gems/1.9.1/gems/mechanize-1.0.0/lib/form.rb:141:in 'submit'

Updated - Error message on form submit
https://i.sstatic.net/Cuo9u.png

Form
https://i.sstatic.net/XlrIm.png

如果你对这篇内容有疑问,欢迎到本站社区发帖提问 参与讨论,获取更多帮助,或者扫码二维码加入 Web 技术交流群。

扫码二维码加入Web技术交流群

发布评论

需要 登录 才能够评论, 你可以免费 注册 一个本站的账号。

评论(1

韵柒 2024-10-24 06:19:47

创建config/initializers/requires.rb
要求“解决替换”
里面

Create config/initializers/requires.rb
with require 'resolv-replace'
inside

~没有更多了~
我们使用 Cookies 和其他技术来定制您的体验包括您的登录状态等。通过阅读我们的 隐私政策 了解更多相关信息。 单击 接受 或继续使用网站,即表示您同意使用 Cookies 和您的相关数据。
原文