# Rake finds & runs task, but doesn't show in --tasks list

**URL:** <https://www.ruby-forum.com/t/rake-finds-runs-task-but-doesnt-show-in-tasks-list/153346>\
**Category:** Ruby\
**Created:** [November 15, 2008, 8:29am UTC](https://www.ruby-forum.com/t/rake-finds-runs-task-but-doesnt-show-in-tasks-list/153346 "2008-11-15T08:29:23Z")\
**Posts on this page:** 4\
**Page:** 1

<div class="post-metadata">

**Author:** ![Hugh\_JSDevlin](https://www.ruby-forum.com/letter_avatar_proxy/v4/letter/h/c5a1d2/32.png) [@Hugh\_JSDevlin](https://www.ruby-forum.com/u/Hugh_JSDevlin)\
**Post date:** [November 15, 2008, 8:29am UTC](https://www.ruby-forum.com/t/rake-finds-runs-task-but-doesnt-show-in-tasks-list/153346/1 "2008-11-15T08:29:23Z")

</div>

hi, rake & ruby-talk newbie, a boy’s 1st rake task, lib/tasks/load.rake:

namespace :load do  
task :hello\_world do |t|  
puts ‘hello, world!’  
end  
end

runs fine:

# rake load:hello\_world

(in … )  
hello, world!

but it’s a no-show in rake --tasks, which just shows the standard rails  
tasks

the task is not listed even when rake is pointed directly at the rake  
file:

# rake -f lib/tasks/load.rake --tasks

(in … )

w/ or w/o explicit namespace in rake file doesn’t help it show up in  
–tasks

rake 0.8.3, rails 2.1.1, ruby 1.8, fedora 9

what am i doing wrong? thanks in advance. sorry if this is a FAQ.

Hugh

---

<div class="post-metadata">

**Author:** ![Hugh\_JSDevlin](https://www.ruby-forum.com/letter_avatar_proxy/v4/letter/h/c5a1d2/32.png) [@Hugh\_JSDevlin](https://www.ruby-forum.com/u/Hugh_JSDevlin)\
**Post date:** [November 15, 2008, 8:37am UTC](https://www.ruby-forum.com/t/rake-finds-runs-task-but-doesnt-show-in-tasks-list/153346/2 "2008-11-15T08:37:33Z")

</div>

Hi Hugh,

On Fri, Nov 14, 2008 at 11:25 PM, Hugh J. Devlin [removed\_email\_address@domain.invalid](mailto:removed_email_address@domain.invalid)  
wrote:

> hi, rake & ruby-talk newbie, a boy’s 1st rake task, lib/tasks/load.rake:
> 
> namespace :load do

# try this:

desc “hello world”

> task :hello\_world do |t|  
> puts ‘hello, world!’  
> end  
> end

Good luck,

---

<div class="post-metadata">

**Author:** ![Hugh\_JSDevlin](https://www.ruby-forum.com/letter_avatar_proxy/v4/letter/h/c5a1d2/32.png) [@Hugh\_JSDevlin](https://www.ruby-forum.com/u/Hugh_JSDevlin)\
**Post date:** [November 15, 2008, 8:43am UTC](https://www.ruby-forum.com/t/rake-finds-runs-task-but-doesnt-show-in-tasks-list/153346/3 "2008-11-15T08:43:24Z")

</div>

Joe S. wrote:

> desc “hello world”
> 
> > task :hello\_world do |t|  
> > puts ‘hello, world!’  
> > end  
> > end

I think this is good reading:  
[http://railsenvy.com/2007/6/11/ruby-on-rails-rake-tutorial](http://railsenvy.com/2007/6/11/ruby-on-rails-rake-tutorial)

Cheers,  
Mohit.  
11/15/2008 | 3:42 PM.

---

<div class="post-metadata">

**Author:** ![Hugh\_JSDevlin](https://www.ruby-forum.com/letter_avatar_proxy/v4/letter/h/c5a1d2/32.png) [@Hugh\_JSDevlin](https://www.ruby-forum.com/u/Hugh_JSDevlin)\
**Post date:** [November 16, 2008, 1:38am UTC](https://www.ruby-forum.com/t/rake-finds-runs-task-but-doesnt-show-in-tasks-list/153346/4 "2008-11-16T01:38:26Z")

</div>

thanks, Joe! that did the trick

("Only tasks with descriptions will be displayed with the “-T” switch. "

- missed that)
