title: How to setup Whenever gem in production (RVM)
body: <p>I've one rake task which i want to execute once every day:
  in production installed rvm</p>
  
  <p>in <strong>schedule.rb</strong> i have</p>
  
  <pre><code>set :output, "/home/username/data/public_html/log/cron_log.log"
  every 24.hours do
    rake "fetch:smth"
  end
  </code></pre>
  
  <p>crontab -l shows me:</p>
  
  <pre><code>MAILTO="my.mail@gmail.com"
  PATH="/usr/local/rvm/rubies/ruby-1.9.3-p125/bin/ruby "
  @daily cd /home/username/data/www/nameofsite.com &amp;&amp; RAILS_ENV=production bundle   exec rake fetch:smth
  </code></pre>
  
  <p>truly, i'm a little bit confused, coz previously i didn't have experience with cron, so plz help. </p>
  
  <p><strong>EDIT #1</strong></p>
  
  <p>i've run <strong>rvm env -- path 1.9.3@global</strong>
  and it gave me:</p>
  
  <pre><code>PATH="/usr/local/rvm/gems/ruby-1.9.3-p125/bin:/usr/local/rvm/gems/ruby-1.9.3-p125@global/bin:/usr/local/rvm/rubies/ruby-1.9.3-p125/bin:/usr/local/rvm/bin:$PATH"
  </code></pre>
  
  <p>and then i've </p>
  
  <pre><code>MAILTO="said.kaldybaev@gmail.com"
  PATH="/usr/local/rvm/gems/ruby-1.9.3-p125/bin:/usr/local/rvm/gems/ruby-1.9.3-p125@global/bin:/usr/local/rvm/rubies/ruby-1.9.3-p125/bin:/usr/local/rvm/bin:$PATH"
  @daily  RAILS_ENV=production rake rate:fetch
  </code></pre>
  
  <p>and when i run execute, from ISPmanager, it gave me: <em>Exited with return code = 1</em>
  the <a href="http://www.gnu.org/software/mcron/manual/html_node/Exit-codes.html" rel="nofollow">link</a> below says that if the exit error is 1, then there is already a /var/run/cron.pid file. and it's true, but i don't have root privileges </p>