RuntimeError handling

#!usr/bin/ruby
require ‘open-uri’
open(“http://www.ruby-lang.org/en”) do |f|
f.each_line { |line| p line }
end

When I run this code,$ruby ex_libraries.rb. I’m seeing the error as,
C:/Ruby193/lib/ruby/1.9.1/open-uri.rb:216:in open_loop': redirection forbidden: http://www.ruby-lang.org/en -> https://www.ruby-lang.org/en (RuntimeError) from C:/Ruby193/lib/ruby/1.9.1/open-uri.rb:146:inopen_uri’
from C:/Ruby193/lib/ruby/1.9.1/open-uri.rb:677:in open' from C:/Ruby193/lib/ruby/1.9.1/open-uri.rb:33:inopen’
from ex_libraries.rb:4:in `’

This forum is not affiliated to the Ruby language, Ruby on Rails framework, nor any Ruby applications discussed here.

| Privacy Policy | Terms of Service | Remote Ruby Jobs