diff --git a/lib/carrierwave/uploader/download.rb b/lib/carrierwave/uploader/download.rb index 27699f428..837ae03fe 100644 --- a/lib/carrierwave/uploader/download.rb +++ b/lib/carrierwave/uploader/download.rb @@ -40,7 +40,7 @@ def file headers = @remote_headers. reverse_merge('User-Agent' => "CarrierWave/#{CarrierWave::VERSION}") - @file = URI.open(@uri.to_s, headers) + @file = (URI.respond_to?(:open) ? URI : Kernel).open(@uri.to_s, headers) @file = @file.is_a?(String) ? StringIO.new(@file) : @file end @file