From 9b01e2b85591c3ed9c648e341d247e32ea516516 Mon Sep 17 00:00:00 2001 From: Sam Date: Wed, 10 Oct 2018 11:16:28 +1100 Subject: [PATCH] FIX: maxmind download task does not need environment --- lib/tasks/maxminddb.rake | 4 +++- 1 file changed, 3 insertions(+), 1 deletion(-) diff --git a/lib/tasks/maxminddb.rake b/lib/tasks/maxminddb.rake index 2af862a72dd..79b31d2899a 100644 --- a/lib/tasks/maxminddb.rake +++ b/lib/tasks/maxminddb.rake @@ -2,7 +2,8 @@ require 'rubygems/package' require 'zlib' desc "downloads MaxMind's GeoLite2-City database" -task "maxminddb:get" => :environment do +task "maxminddb:get" do + puts "Downloading maxmind db" uri = URI("http://geolite.maxmind.com/download/geoip/database/GeoLite2-City.tar.gz") tar_gz_archive = Net::HTTP.get(uri) @@ -13,6 +14,7 @@ task "maxminddb:get" => :environment do next unless entry.full_name.ends_with?(".mmdb") filename = File.join(Rails.root, 'vendor', 'data', 'GeoLite2-City.mmdb') + puts "Writing #{filename}" File.open(filename, "wb") do |f| f.write(entry.read) end