title: File paths in Ruby
body: <p>So I want to make a file path relative to the directory it is in, in Ruby. </p>
  
  <p>I have a project, and I want it to be able to find the file no matter what directory the project is unzipped into. (Say the code is run on different machines, for example)  I can't figure it out for the life of me.</p>
  
  <p>It seems for requires that I can do this:</p>
  
  <pre><code>require File.dirname(__FILE__) + '/comparison'
  </code></pre>
  
  <p>What can I do for a file that is in a different directory than my src folder?</p>
  
  <p>Instead of listing,</p>
  
  <pre><code>file = 'C:/whole path/long/very_long/file.txt'
  </code></pre>
  
  <p>I'd like to say:</p>
  
  <pre><code>file = 'file.txt'
  </code></pre>
  
  <p>or</p>
  
  <pre><code>file = File.helpful_method + 'file.txt'
  </code></pre>