Skip to content
Dmitry Polushkin edited this page May 26, 2014 · 1 revision
Rake task to download .dat file in Rails
namespace :geoip do
  desc 'update geoip database'
  task :update do
    url = 'http://geolite.maxmind.com/download/geoip/database/GeoLiteCountry/GeoIP.dat.gz'
    system "curl #{url} | gzip -d > #{Rails.root.to_s}/db/geoip/GeoIP.dat"
  end
end
Capistrano
set :shared_children, shared_children + %w{db/geoip}
Clone this wiki locally