404 error with open-uri in a rake task… what's causing it?
I have a rake task that fetches JSON data from an API, parses it, and saves it to the database: task :embedly => :environment do require 'json' require 'uri' require 'open-uri' Video.all.each do |video| json_stream = open("http://api.embed.ly/1/oembed?key=08b652e6b3ea11e0ae3f4040d3dc5c07&url=#{video.video_url}&maxwidth=525") ruby_hash = JSON.parse(json_stream.read) thumbnail_url = ruby_hash['thumbnail_url'] embed_code = ruby_hash['html'] video.update_attributes(:thumbnail_url => thumbnail_url, :embed_code => embed_code) end end I get this error in the stack trace when I run the rake task and I