felix
felix

Reputation: 11542

What is the purpose of RakeFile in the application root directory

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

Answers (2)

Flavius Stef
Flavius Stef

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

Simone Carletti
Simone Carletti

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

Related Questions