Rails Tip #5: Clean Up Using Rake

Rails comes with a number of Rake tasks for cleaning up various temporary files that get generated when you run your application.

  • rake tmp:clear Clear all files in tmp/
  • rake tmp:cache:clear Clear all files and directories in tmp/cache
  • rake tmp:sessions:clear Clear all files in tmp/sessions
  • rake tmp:sockets:clear Clear all files in tmp/sockets

—Rake can also clear the sessions table if you’re using one:

rake db:sessions:clear

Leave a Reply