From: Lex Williams Date: 2008-08-30T16:03:52+09:00 Subject: Re: how to use gsub method? This is your code : require 'net/http' page= Net::HTTP.new('www.google.co.kr',80) reg = page.get('/index.html') reg.gsub(/a/) {|gg| puts gg} puts reg Your are trying to use gsub on the object returned by Net::HTTP , which isn't a string . Your code should look like this : require 'net/http' page= Net::HTTP.new('www.google.co.kr',80) reg = page.get('/index.html') reg.body.gsub!(/a/) {|gg| puts gg} puts reg.body Pay attention to the gsub! , which modifies the string in-place .Judging by your script,that is what you want . -- Posted via http://www.ruby-forum.com/.