If you have done anything with Rails at all, you’re probably familiar with the Rake command. Rake is a task runner in Ruby. It allows you to define a list of other tasks that must run before the current task. While it might sound complicated, let’s take a look at it together.
Rake is a popular task runner in Ruby.
What is a task?
- Making a backup of your database
- Running your tests
- Gathering & reporting stats
These are small tasks that without Rake would be scattered all over your project on different files. Rake centralizes access to your tasks. It also makes a few things easier, like finding files that match a certain pattern and that have been modified recently.
Here’s a list of useful Rake options:
- rake -T (list available tasks)
- rake -P (list tasks & their dependencies)
- rake -W (list tasks & where they are defined)
- rake -V (verbose mode, echo system commands)
- rake -t (debugging mode)
- rake -f (use a specific Rakefile)
Learn more about it here.
We always glad to share our experience, so read more on developing Ruby on Rails web application.