Skip to main content
2 of 2
replaced http://stackoverflow.com/ with https://stackoverflow.com/

Adding to the existing answers:

  1. You don't need to require rubygems as you are not using it at all. It is usually unnecessary. See here https://stackoverflow.com/questions/2711779/require-rubygems .

  2. When you have many requires you can do this trick to group them into one line:

    require 'rubygems'
    require 'mechanize'
    require 'json'
    require 'net/http'
    

    Into

    %w{rubygems mechanize json net/http}.each{|gem| require gem}
    
Mohammad
  • 1.3k
  • 1
  • 10
  • 29