Warning: file_get_contents(/data/phpspider/zhask/data//catemap/8/logging/2.json): failed to open stream: No such file or directory in /data/phpspider/zhask/libs/function.php on line 167

Warning: Invalid argument supplied for foreach() in /data/phpspider/zhask/libs/tag.function.php on line 1116

Notice: Undefined index: in /data/phpspider/zhask/libs/function.php on line 180

Warning: array_chunk() expects parameter 1 to be array, null given in /data/phpspider/zhask/libs/function.php on line 181
Ruby 代理程序的未定义方法代理:模块_Ruby - Fatal编程技术网

Ruby 代理程序的未定义方法代理:模块

Ruby 代理程序的未定义方法代理:模块,ruby,Ruby,我有个问题 我安装了Subc: gem install proxifier 然后创建了socks.rb: require "proxifier/proxy" proxy = Proxifier::Proxy("socks://" + ARGV[0]) socket = proxy.open("www.google.com", 80) socket << "GET / HTTP/1.1\r\nHost: www.google.com\r\n\r\n" socket.gets 需要

我有个问题

我安装了Subc:

gem install proxifier
然后创建了socks.rb:

require "proxifier/proxy"

proxy = Proxifier::Proxy("socks://" + ARGV[0])
socket = proxy.open("www.google.com", 80)
socket << "GET / HTTP/1.1\r\nHost: www.google.com\r\n\r\n"
socket.gets
需要“代理/代理”
proxy=Proxifier::proxy(“socks://”+ARGV[0])
socket=proxy.open(“www.google.com”,80)

套接字而不是需要“proxifier/proxy”使用

需要“proxifier”

我试过了,但D:/tmp/ruby/lib/ruby/gems/1.9.1/gems/proxifier-1.0.2/lib/proxifier/proxy.rb:26:I打开:未定义的局部变量或方法proxy'from socks.rb:4:in'
ruby socks.rb 127.0.0.1:1080
socks.rb:3:in `<main>': undefined method `Proxy' for Proxifier:Module (NoMethodE
rror)