Reputation: 11542
I am using Ruby on Rails and I see a 'Rakefile' in my application's root directory. What is its purpose and when will it get executed?
Upvotes: 2
Views: 1157
Reputation: 13798
It contains several pre-defined actions (named tasks) that you could perform on the Rails project. If you run rake -T
, it will show you a list of all available tasks. That will provide you with more info.
Upvotes: 3
Reputation: 176372
The Rakefile
is a ruby-written file which contains the definition of Rake tasks.
Here you can find a small introduction to Rake.
The Rakefile
can include other Ruby files. This is the case of Rails projects.
In fact, in a Rails project you shouldn't change the Rakefile directly. Instead, you can add more rake tasks by creating .rake files in the lib/tasks
folder of your Rails project.
Upvotes: 4