title: Setting path for whenever in cron so it can find ruby
body: <p>My ruby is in /usr/local/bin. <a href="https://github.com/javan/whenever/" rel="nofollow noreferrer">whenever</a> can't find it, and setting PATH at the top of my cron file doesn't work either, I think because whenever is running the command inside of a new bash instance.</p>
  
  <pre>
  # this does not work
  PATH=/bin:/sbin:/usr/bin:/usr/sbin:/usr/local/sbin
  
  # Begin Whenever generated tasks for: foo
  0 * * * * /bin/bash -l -c 'cd /srv/foo/releases/20110429110637 && script/rails runner -e production '\''ActiveRecord::SessionStore::Session.destroy_recent(15)'\'''
  
  # End Whenever generated tasks for: foo
  </pre>
  
  <p>How can I tell whenever where my ruby binary is? Making a symbolic link from /usr/bin seems messy to me, but I guess that might be the only option.</p>
  
  <p><a href="https://stackoverflow.com/questions/5698028/whenever-path-in-crontab-file-for-rails-3-ubuntu">This question</a> offers <code>env :PATH, "..."</code> in schedule.rb as a solution, but (a) I can't find any documentation of that feature anywhere in the docs (b) it doesn't seem to have solved the asker's problem (unfortunately it takes non-trivial turnaround time for me to just try it).
  <strong>update</strong> actually <a href="https://github.com/javan/whenever/wiki/Instructions-and-Examples" rel="nofollow noreferrer">it is in the bottom of this page</a>, i'll try it now.</p>
  
  <p><strong>more info</strong></p>
  
  <ol>
  <li>I can't modify the cron command because it's generated by whenever</li>
  <li>i verified that if I make a new bash shell with <code>bash -l</code>, /usr/bin/env finds ruby just fine</li>
  <li>I just tried the exact command in cron, starting with /bin/bash, from the command line of that user, and it worked.</li>
  </ol>
  
  <p>so, this is very mysterious...</p>