From: Matthew Kerwin Date: 2012-03-29T20:26:22+09:00 Subject: Re: uninitialized constant SOCKSSocket Oh and be sure to stringify/symbolify that undefined const: ... end unless defined? :SOCKSSocket On 29/03/2012, Matthew Kerwin wrote: > It appears the class is only being defined if it's already defined. > Maybe change the last line's "if" to "unless" ..? > > On 29/03/2012, Resident Moron wrote: >> I am running ruby 1.9.3 on a linux box. I would like to use >> SOCKSSocket, however, I continue to run into the following error: >> >> uninitialized constant SOCKSSocket >> >> simple test using IRB >> irb(main):001:0> require 'resolv-replace' >> => true >> irb(main):002:0> SOCKSSocket >> NameError: uninitialized constant SOCKSSocket >> from (irb):2 >> from /usr/local/bin/irb:12:in `
' >> >> here is the source code directly from resolv-replace.rb >> class SOCKSSocket < TCPSocket >> # :stopdoc: >> alias original_resolv_initialize initialize >> # :startdoc: >> def initialize(host, serv) >> original_resolv_initialize(IPSocket.getaddress(host), port) >> end >> end if defined? SOCKSSocket >> >> I can't help but think that I need to install some dependency needed to >> enable socks or something. Anything would be helpful. >> >> -- >> Posted via http://www.ruby-forum.com/. >> >> > > > -- > Matthew Kerwin, B.Sc (CompSci) (Hons) > http://matthew.kerwin.net.au/ > > "You'll never find a programming language that frees > you from the burden of clarifying your ideas." - xkcd > > -- Matthew Kerwin, B.Sc (CompSci) (Hons) http://matthew.kerwin.net.au/ "You'll never find a programming language that frees you from the burden of clarifying your ideas." - xkcd