title: How to test things in crontab
body: <p>This keeps happening to me all the time:
  1) I write a script(ruby, shell, etc).
  2) run it, it works.
  3) put it in crontab so it runs in a few minutes so I know it runs from there.
  4) It doesnt, no error trace, back to step 2 or 3 a 1000 times.</p>
  
  <p>When I ruby script fails in crontab, I can't really know why it fails cause when I pipe output like this:</p>
  
  <pre><code>ruby script.rb &gt;&amp; /path/to/output
  </code></pre>
  
  <p>I sorta get the output of the script, but I don't get any of the errors from it and I don't get the errors coming from bash (like if ruby is not found or file isn't there)</p>
  
  <p>I have no idea what environmental variables are set and whether or not it's a problem. Turns out that to run a ruby script from crontab you have to export a ton of environment variables.</p>
  
  <p>Is there a way for me to just have crontab run a script as if <strong>I ran it myself from my terminal</strong>?</p>
  
  <p>When debugging, I have to reset the timer and go back to waiting. Very time consuming.</p>
  
  <p>How to test things in crontab better or avoid these problems?</p>