From: Samuel Sternhagen Date: 2010-08-09T11:18:40+09:00 Subject: Need help passing variable to Net::HTTP I have used Net::HTTP like this: Net::HTTP.get 'google.com', '/index.html' I would like to pass it a variable instead. I tried this: irb(main):001:0> require 'net/http' => true irb(main):002:0> url = String.new => "" irb(main):003:0> url = "'google.com', '/index.html'" => "'google.com', '/index.html'" irb(main):004:0> Net::HTTP.get_print(url) NoMethodError: undefined method `host' for "'google.com', '/index.html'":String from /usr/lib/ruby/1.8/net/http.rb:379:in `get_response' from /usr/lib/ruby/1.8/net/http.rb:337:in `get_print' from (irb):4 from :0 How do I pass a variable to Net:HTTP ? -- Posted via http://www.ruby-forum.com/.