views:

30

answers:

2

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?

+2  A: 

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.

Simone Carletti
+2  A: 

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.

Flavius Stef