Found the problem. There is a patch to the open-uri.rb file in the ruby library.
Replace:
(/\A(?:http|ftp)\z/i =~ uri1.scheme && /\A(?:http|ftp)\z/i =~ uri2.scheme)
With:
(/\A(?:https?|ftp)\z/i =~ uri1.scheme && /\A(?:https?|ftp)\z/i =~ uri2.scheme)
in the open-uri.rb file. The problem is with http -> https redirects. This file was found for me in:
/Users/MyName/.rvm/rubies/ruby-2.0.0-p0/lib/ruby/2.0.0/open-uri.rb