title: Rails Whenever gem cron fe_sendauth: no password supplied
body: <p>I am running a Rails server that periodically runs a <code>rake task</code> using whenever gem and cron.</p>
  
  <p>I can run the <code>rake task</code> using these successfully. On my remote server, I am running that as the root. This second attempt also works.</p>
  
  <pre><code>     RAILS_ENV=production rake fetch_myitems
       // attempt 1
       //attempt 2
       /bin/bash -l -c 'cd /home/rails/AniKawaii &amp;&amp; RAILS_ENV=production bundle exec rake fetch_animegifs --silent &gt;&gt; log/whenever.log 2&gt;&amp;1'
  </code></pre>
  
  <p>After debugging, this is what I ended up with as the source of error. I understand that this is related to database.yml. However I can deploy to my live production server successfully and calling <code>RAILS_ENV=production rake fetch_myitems</code> does not trigger this error so I am confused as to what to do.</p>
  
  <pre><code>PG::ConnectionBad: fe_sendauth: no password supplied
  </code></pre>
  
  <h3>Crontab -l</h3>
  
  <pre><code>0,5,10,15,20,25,30,35,40,45,50,55 * * * * /bin/bash -l -c 'cd /home/rails/AniKawaii &amp;&amp; RAILS_ENV=production bundle exec rake fetch_animegifs --silent &gt;&gt; log/whenever.log 2&gt;&amp;1'
  </code></pre>