我得到了这些警告--我用Ruby运行的所有东西。
mechanize/cookie will be deprecated. Please migrate to the http-cookie APIs.
mechanize/cookie_jar will be deprecated. Please migrate to the http-cookie APIs.我似乎找不到任何关于如何更改代码以便清除这些错误的文档。
#!/usr/bin/ruby -w
require 'rubygems'
require 'mechanize'
a = Mechanize.new { |agent|
agent.user_agent_alias = 'Mac Safari'
}
title = a.get('http://google.com').title
puts title我想我需要安装一些满足这些要求的东西?
请迁移到http-cookie API。
编辑1
安装gem install http-cookie不会对这些警告产生影响。我不知道机器是否知道使用http-cookie,还是它只是使用了不正确的cookie_jar。
发布于 2016-01-20 04:33:09
每当我遇到这样的错误时,我都会做如下的事情:
bundle list my_gem
cd <DIR>
ag 'Please migrate to'这通常会给我指出问题的根源。
编辑:注意到http-cookies显示它是从机械化:https://github.com/sparklemotion/http-cookie中提取的。
https://stackoverflow.com/questions/34891637
复制相似问题