Forum: Ruby rake finds & runs task, but doesn't show in --tasks list

Announcement (2017-05-07): www.ruby-forum.com is now read-only since I unfortunately do not have the time to support and maintain the forum any more. Please see rubyonrails.org/community and ruby-lang.org/en/community for other Rails- und Ruby-related community platforms.
429362a395ff621b37a46d0545794f30?d=identicon&s=25 Hugh J. Devlin (Guest)
on 2008-11-15 08:29
(Received via mailing list)
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
18a3f5cbba162d78a6c238115341134d?d=identicon&s=25 Joe Swatosh (Guest)
on 2008-11-15 08:37
(Received via mailing list)
Hi Hugh,

On Fri, Nov 14, 2008 at 11:25 PM, Hugh J. Devlin <hdevlin@ameritech.net>
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,
34a7615f38496a5dafbb3e6b721c435e?d=identicon&s=25 Mohit Sindhwani (Guest)
on 2008-11-15 08:43
(Received via mailing list)
Joe Swatosh 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

Cheers,
Mohit.
11/15/2008 | 3:42 PM.
429362a395ff621b37a46d0545794f30?d=identicon&s=25 Hugh J. Devlin (Guest)
on 2008-11-16 01:38
(Received via mailing list)
thanks, Joe! that did the trick

("Only tasks with descriptions will be displayed with the "-T" switch. "
- missed that)
This topic is locked and can not be replied to.