title: Load gems inside scripts run from the shell outside our Rails application directory?
body: <p>We have a mail gem installed in our vendor/cache directory inside a Rails application.</p>
  
  <p>The script is called "test" and is not inside the Rails application directory.</p>
  
  <pre><code>#! /usr/local/rvm/wrappers/ruby-1.9.3-p194/ruby
  
  require 'date'
  require 'fileutils'
  require 'openssl'
  require 'yaml'
  require 'mail'
  require 'dalli'
  </code></pre>
  
  <p>I get the following error when I execute this script from outside the Rails application. </p>
  
  <pre><code>/usr/local/rvm/rubies/ruby-1.9.3-p194/lib/ruby/site_ruby/1.9.1/rubygems/custom_require.rb:36:in `require': cannot load such file -- mail (LoadError)
      from /usr/local/rvm/rubies/ruby-1.9.3-p194/lib/ruby/site_ruby/1.9.1/rubygems/custom_require.rb:36:in `require'
  </code></pre>
  
  <p>I simply re-installed these gems (mail, dalli) in the standard Ruby path and it worked, but that's not ideal.</p>
  
  <p>What do we need to so that these installed gems are found when we try to run this script outside of a Rails app? In other words, how do we specify the path to these gems?</p>