Where does rake get its default rakefile?

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

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

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?

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 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?

On Feb 19, 5:48 pm, Pito S. [email protected] 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