In order to use logrotate with Rails you just need to create the file /etc/logrotate.d/rails with the following content:

/home/ubuntu/rails_folder/shared/log/*.log {
  daily
  missingok
  compress
  notifempty
  copytruncate
}

And to make sure it works:

sudo logrotate -f /etc/logrotate.d/rails