# Where does rake get its default rakefile?

**URL:** <https://www.ruby-forum.com/t/where-does-rake-get-its-default-rakefile/183714>\
**Category:** Rails\
**Created:** [February 18, 2010, 11:45pm UTC](https://www.ruby-forum.com/t/where-does-rake-get-its-default-rakefile/183714 "2010-02-18T23:45:52Z")\
**Posts on this page:** 6\
**Page:** 1

<div class="post-metadata">

**Author:** ![pitosalas](https://www.ruby-forum.com/letter_avatar_proxy/v4/letter/p/a4c791/32.png) [@pitosalas](https://www.ruby-forum.com/u/pitosalas)\
**Post date:** [February 18, 2010, 11:45pm UTC](https://www.ruby-forum.com/t/where-does-rake-get-its-default-rakefile/183714/1 "2010-02-18T23:45:52Z")

</div>

In Rails 2.3.x, in a rails app directory, I type “rake”.

The top rakefile is sitting right there but it has almost nothing in it.  
Obviously rake is looking elsewhere for the collection of default tasks.

Where is it looking? I can’t figure it out…

Thanks for any assistance,

Pito

---

<div class="post-metadata">

**Author:** ![pitosalas](https://www.ruby-forum.com/letter_avatar_proxy/v4/letter/p/a4c791/32.png) [@pitosalas](https://www.ruby-forum.com/u/pitosalas)\
**Post date:** [February 18, 2010, 11:53pm UTC](https://www.ruby-forum.com/t/where-does-rake-get-its-default-rakefile/183714/2 "2010-02-18T23:53:20Z")

</div>

> In Rails 2.3.x, in a rails app directory, I type “rake”.
> 
> The top rakefile is sitting right there but it has almost nothing in  
> it.  
> Obviously rake is looking elsewhere for the collection of default  
> tasks.
> 
> Where is it looking? I can’t figure it out…

Follow the rabbit down the trail…

Rakefile require’s config/boot. That file defines some things and  
runs Rails.boot! Which does some more stuff. At some point along that  
trail it’s picking up the default tasks.

-philip

---

<div class="post-metadata">

**Author:** ![pitosalas](https://www.ruby-forum.com/letter_avatar_proxy/v4/letter/p/a4c791/32.png) [@pitosalas](https://www.ruby-forum.com/u/pitosalas)\
**Post date:** [February 18, 2010, 11:55pm UTC](https://www.ruby-forum.com/t/where-does-rake-get-its-default-rakefile/183714/3 "2010-02-18T23:55:22Z")

</div>

Philip H. wrote:

> > In Rails 2.3.x, in a rails app directory, I type “rake”.
> > 
> > The top rakefile is sitting right there but it has almost nothing in  
> > it.  
> > Obviously rake is looking elsewhere for the collection of default  
> > tasks.
> > 
> > Where is it looking? I can’t figure it out…
> 
> Follow the rabbit down the trail…
> 
> Rakefile require’s config/boot. That file defines some things and  
> runs Rails.boot! Which does some more stuff. At some point along that  
> trail it’s picking up the default tasks.
> 
> -philip

Yeah I did follow the rabbit before I posted but I got lost down  
there… So there’s no simple answer, like different tasks come from  
different places?

---

<div class="post-metadata">

**Author:** ![pitosalas](https://www.ruby-forum.com/letter_avatar_proxy/v4/letter/p/a4c791/32.png) [@pitosalas](https://www.ruby-forum.com/u/pitosalas)\
**Post date:** [February 19, 2010, 12:58am UTC](https://www.ruby-forum.com/t/where-does-rake-get-its-default-rakefile/183714/4 "2010-02-19T00:58:19Z")

</div>

> > Follow the rabbit down the trail…  
> > different places?  
> > Ah. Gotcha.

The default rails tasks come out of vendor/rails/railties/lib/tasks.  
You’re own tasks get picked up out of lib/tasks.  
Plugin tasks come out of vendor/plugins/\*\*\*\*/tasks.

-philip

---

<div class="post-metadata">

**Author:** ![pitosalas](https://www.ruby-forum.com/letter_avatar_proxy/v4/letter/p/a4c791/32.png) [@pitosalas](https://www.ruby-forum.com/u/pitosalas)\
**Post date:** [February 19, 2010, 6:48pm UTC](https://www.ruby-forum.com/t/where-does-rake-get-its-default-rakefile/183714/5 "2010-02-19T18:48:39Z")

</div>

Philip H. wrote:

> > > Follow the rabbit down the trail…  
> > > different places?  
> > > Ah. Gotcha.
> 
> The default rails tasks come out of vendor/rails/railties/lib/tasks.  
> You’re own tasks get picked up out of lib/tasks.  
> Plugin tasks come out of vendor/plugins/\*\*\*\*/tasks.
> 
> -philip

Philip thanks,but let me admit my ignorance some more… My rails is not  
in vendor (which is not surprising from my understanding that this only  
happens when you freeze rails into the app…) So a further pointer?

---

<div class="post-metadata">

**Author:** ![pitosalas](https://www.ruby-forum.com/letter_avatar_proxy/v4/letter/p/a4c791/32.png) [@pitosalas](https://www.ruby-forum.com/u/pitosalas)\
**Post date:** [February 19, 2010, 7:21pm UTC](https://www.ruby-forum.com/t/where-does-rake-get-its-default-rakefile/183714/6 "2010-02-19T19:21:12Z")

</div>

On Feb 19, 5:48 pm, Pito S. [removed\_email\_address@domain.invalid](mailto:removed_email_address@domain.invalid) wrote:

> Philip thanks,but let me admit my ignorance some more… My rails is not  
> in vendor (which is not surprising from my understanding that this only  
> happens when you freeze rails into the app…) So a further pointer?

Requiring boot sets things up so that the rails gems are ready to be  
required or the appropriate folders in vendor/rails are put on the  
load path, which then ensures that the require ‘tasks/rails’ line in  
the default Rakefile can be run (which maps to railties/lib/tasks/  
rails.rb) which goes off and finds \*.rake files in the rails  
framework.

Fred
