title: Rails Rake task displayed execution expired message and program stopped
body: <p>I have a rake task to load car's image from the table websites using paperclip. The image stored in database as a remote link. </p>
  
  <p>Here is my code and i'm using ruby 1.8.7, rails 2.3.8 and DB mysql.</p>
  
  <pre><code>namespace :db do
  
    task :load_photo  =&gt; :environment do
    require 'rubygems'
    require 'open-uri'
    require 'net/http'
    require 'paperclip'
    begin
    images =Website.find(:all,:conditions=&gt;["image_url is not null"])
    images.each do |photo|
       url = URI.parse(photo.image_url)
       Net::HTTP.start(url.host, url.port) do |http|
           if http.head(url.request_uri).code == "200"
             Car.update_attribute(:photo,open(url))
           end
       end
    end
    rescue Exception =&gt; e
    end
   end 
   end 
  </code></pre>
  
  <p>Run above rake task by db:load_photo. In my table (Website) has 60,000 rows. Rake task running upto 10000 rows only and execution terminated with an error message <strong>"execution expired"</strong>.</p>
  
  <p>Can any one help me to figure this out?</p>
  
  <p>Thanks in advance.</p>