Parse webpage and save fetched images to a directory
Few minor issues:


It will be cool if you support URL parameter with protocol (HTTP/HTTPS):

doc = Nokogiri::HTML(open("http://#{url}"))

For URL manipulations you can use standard tools - URI::HTTP/URI:HTTPS instead regexps:

name = img_src.match(/^http:\/\/.*\/(.*)$/)
img_srcs[index] = "http://#{url}/#{img_src}" unless   img_src.match(/http:\/\//)

This is a little unsecure operation, you should escape name:

File.open("#{path}/#{name}", "wb")

You ignore links with HTTPS protocol:

img_src.match(/http:\/\//)

This is not the Ruby way:

img_srcs.each_with_index do |img_src, index|
  img_srcs[index] = "http://#{url}/#{img_src}" unless   img_src.match(/http:\/\//)
end
img_srcs


A little simpler

img_srcs.map do |src|
  src.match(/http:\/\//) ? "http://#{url}/#{src}" : src
end

You load page uneffiсiently:

image = open(img_src)


So for every image temp file created.  This may not be an efficient way.

open("http://stackoverflow.com/questions/1878891/how-to-load-a-web-page-and-search-for-a-word-in-ruby").class
=&gt; Tempfile