How can I download a file from a URL and save it in Rails? October 11, 2022 by Tarik Try this: require 'open-uri' open('image.png', 'wb') do |file| file << open('http://example.com/image.png').read end