Script is location-sensitive. This is related to always using absolute paths in a script, but not quite the same. Your cron job may need to cd to a specific directory before running, e.g. a rake task on a Rails application may need to be in the application root for Rake to find the correct task, not to mention the appropriate database configuration, etc.
So a crontab entry of
23 3 * * * /usr/bin/rake db:session_purge RAILS_ENV=production
would be better as
23 3 * * * cd /var/www/production/current && /usr/bin/rake db:session_purge RAILS_ENV=production
Or, to keep the crontab entry simpler and less brittle:
23 3 * * * /home/<user>/scripts/session-purge.sh
with the following code in /home/<user>/scripts/session-purge.sh:
cd /var/www/production/current/usr/bin/rake db:session_purge RAILS_ENV=production