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

Discussion in 'Ruby' started by Hugh J. Devlin, Nov 15, 2008.

  1. 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
    Hugh J. Devlin, Nov 15, 2008
    #1
    1. Advertising

  2. Hugh J. Devlin

    Joe Swatosh Guest

    Hi Hugh,

    On Fri, Nov 14, 2008 at 11:25 PM, Hugh J. Devlin <> 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,
    --
    Joe
    Joe Swatosh, Nov 15, 2008
    #2
    1. Advertising

  3. Joe Swatosh wrote:
    > Hi Hugh,
    >
    > On Fri, Nov 14, 2008 at 11:25 PM, Hugh J. Devlin <> 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
    >>


    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.
    Mohit Sindhwani, Nov 15, 2008
    #3
  4. thanks, Joe! that did the trick

    ("Only tasks with descriptions will be displayed with the "-T" switch. "
    - missed that)

    Joe Swatosh wrote:
    > # try this:
    > desc "hello world
    Hugh J. Devlin, Nov 16, 2008
    #4
    1. Advertising

Want to reply to this thread or ask your own question?

It takes just 2 minutes to sign up (and it's free!). Just click the sign up button to choose a username and then you can ask your own questions on the forum.
Similar Threads
  1. Trans
    Replies:
    0
    Views:
    94
    Trans
    Feb 5, 2007
  2. peppermonkey
    Replies:
    1
    Views:
    224
    Gregory Brown
    Feb 10, 2007
  3. Stéphane Wirtel
    Replies:
    3
    Views:
    354
    Stephane Wirtel
    Jun 15, 2007
  4. James Mead
    Replies:
    0
    Views:
    136
    James Mead
    Jan 15, 2008
  5. John Feminella
    Replies:
    0
    Views:
    226
    John Feminella
    Apr 25, 2010
Loading...

Share This Page