title: Rails cron with whenever
body: <p>I don't understand why "whenever" does not work</p>
  
  <p>Schedule.rb</p>
  
  <pre><code>every 2.minutes do
    runner "Ping.check_pings"
  end
  </code></pre>
  
  <p>Ping.rb</p>
  
  <pre><code>class Ping &lt; ActiveRecord::Base
      attr_accessible :LAN, :WAN, :info, :infastructure_id
  
      def self.check_pings      
        @monitor_ping = Ping.new()    
        @monitor_ping.WAN = "true"
        @monitor_ping.save 
      end
  end
  </code></pre>
  
  <p>crontab -l</p>
  
  <pre><code>0,2,4,6,8,10,12,14,16,18,20,22,24,26,28,30,32,34,36,38,40,42,44,46,48,50,52,54,56,58 * * * * /bin/bash -l -c 'cd /home/ruben/Monitoring &amp;&amp; script/rails runner -e production '\''Ping.check_pings'\'''
  </code></pre>
  
  <p>rails runner "Ping.check_pings"
  ==> Works in command line</p>
  
  <p>I tried it with my project running in "rails s" and without
  What am i doing wrong?</p>