title: What's the best way to do multiple requires in Ruby?
body: <p>I'm not sure I've seen this addressed, but I am wondering what is the best way to do multiple requires in a ruby script. I have come up with a couple rudimentary examples which I will outline below, but I'm not sure if there is a best practice for this -- my search results have come back with nothing.</p>
  
  <p>0) Bunch of includes &amp; exceptions (I'll leave the rescue out)</p>
  
  <pre><code>require 'rubygems'
  require 'builder'
  </code></pre>
  
  <p>1) String array</p>
  
  <pre><code>torequire = ['rubygems', 'builder']
  begin
    torequire.each do |req|
      require req
  rescue LoadError =&gt; e
    # Not sure if this is great either
    puts "Missing required gem: " + e.message.split[-1]
    exit
  end
  </code></pre>
  
  <p>2) ??</p>
  
  <p>Is there a large problem created from loading them all from a string array? You could specify version requirements or locations similarly, I'm just wondering if there is a problem with doing it this way.</p>