Stop using Ruby to back up the postgres database in your Rails app. Use bash instead!
##Install:
cd /usr/local/bin
git clone https://gist.github.com/4552332.git db_backup
chmod +x db_backup/db_backup.sh
cp db_backup/db_backup /etc/cron.d/
Then you need to create a backup folder that the postgres user can write to:
mkdir -p /backup
chown postgres:postgres /backup
Restart your cron and enjoy the easy backups. Enjoy!
##What's next?
These backups are stored on your server. That ain't good. The next steps are to get the backups moving over to S3 using either s3cmd or s3fs