# Rake 0.8.1 command line parameter problem?

**URL:** <https://www.ruby-forum.com/t/rake-0-8-1-command-line-parameter-problem/137943>\
**Category:** Ruby\
**Created:** [May 18, 2008, 6:55pm UTC](https://www.ruby-forum.com/t/rake-0-8-1-command-line-parameter-problem/137943 "2008-05-18T18:55:52Z")\
**Posts on this page:** 2\
**Page:** 1

<div class="post-metadata">

**Author:** ![vh1](https://www.ruby-forum.com/letter_avatar_proxy/v4/letter/v/278dde/32.png) [@vh1](https://www.ruby-forum.com/u/vh1)\
**Post date:** [May 18, 2008, 6:55pm UTC](https://www.ruby-forum.com/t/rake-0-8-1-command-line-parameter-problem/137943/1 "2008-05-18T18:55:52Z")

</div>

This could be just me and my ignorance, but I can’t seem to figure it  
out. I’ve been playing with the new command-line parameters feature in  
Rake 0.8.1 (for which I give much thanks, btw - setting those  
environment variables was getting tedious).

SImplifying, I have these:

task :q do  
puts ‘q’  
end

task 😛 =\> :q do  
puts ‘p’  
end

task :r, :x do |t, args|  
puts args.x  
end

which I invoke with the following, all of which behave as I expect:  
rake q  
rake p  
rake r[a]

But for the life of me, I can’t figure out how to specify a task that  
takes arguments and has a dependency - this:

task :s , :x =\> :q do |t, args|  
puts args.x  
end

…looks like the most likely form of the many I’ve tried, but it also  
fails:  
rake aborted!  
Don’t know how to build task ‘’

Switching on trace gets me this

c:/ruby/lib/ruby/gems/1.8/gems/rake-0.8.1/lib/rake.rb:1634:in `[]' c:/ruby/lib/ruby/gems/1.8/gems/rake-0.8.1/lib/rake.rb:516:in`invoke\_prerequisites’  
c:/ruby/lib/ruby/gems/1.8/gems/rake-0.8.1/lib/rake.rb:1183:in `each' c:/ruby/lib/ruby/gems/1.8/gems/rake-0.8.1/lib/rake.rb:1183:in`send’  
c:/ruby/lib/ruby/gems/1.8/gems/rake-0.8.1/lib/rake.rb:1183:in `each' c:/ruby/lib/ruby/gems/1.8/gems/rake-0.8.1/lib/rake.rb:515:in`invoke\_prerequisites’  
c:/ruby/lib/ruby/gems/1.8/gems/rake-0.8.1/lib/rake.rb:507:in  
`invoke_with_call_chain' c:/ruby/lib/ruby/gems/1.8/gems/rake-0.8.1/lib/rake.rb:501:in`synchronize’  
c:/ruby/lib/ruby/gems/1.8/gems/rake-0.8.1/lib/rake.rb:501:in  
`invoke_with_call_chain' c:/ruby/lib/ruby/gems/1.8/gems/rake-0.8.1/lib/rake.rb:494:in`invoke’  
c:/ruby/lib/ruby/gems/1.8/gems/rake-0.8.1/lib/rake.rb:1931:in  
`invoke_task' c:/ruby/lib/ruby/gems/1.8/gems/rake-0.8.1/lib/rake.rb:1909:in`top\_level’  
c:/ruby/lib/ruby/gems/1.8/gems/rake-0.8.1/lib/rake.rb:1909:in `each' c:/ruby/lib/ruby/gems/1.8/gems/rake-0.8.1/lib/rake.rb:1909:in`top\_level’  
c:/ruby/lib/ruby/gems/1.8/gems/rake-0.8.1/lib/rake.rb:1948:in  
`standard_exception_handling' c:/ruby/lib/ruby/gems/1.8/gems/rake-0.8.1/lib/rake.rb:1903:in`top\_level’  
c:/ruby/lib/ruby/gems/1.8/gems/rake-0.8.1/lib/rake.rb:1881:in `run' c:/ruby/lib/ruby/gems/1.8/gems/rake-0.8.1/lib/rake.rb:1948:in`standard\_exception\_handling’  
c:/ruby/lib/ruby/gems/1.8/gems/rake-0.8.1/lib/rake.rb:1878:in `run' c:/ruby/lib/ruby/gems/1.8/gems/rake-0.8.1/bin/rake:31 c:/ruby/bin/rake:16:in`load’  
c:/ruby/bin/rake:16

If I’m being dumb, please educate me! If there’s a better place to  
post this, and I couldn’t find one, please let me know. And if it  
should be a bug (I’ll keep working on understanding what’s happening  
in the meantime), then at least I’ll know someone’s now aware of it…

Thanks.

Mike

---

<div class="post-metadata">

**Author:** ![vh1](https://www.ruby-forum.com/letter_avatar_proxy/v4/letter/v/278dde/32.png) [@vh1](https://www.ruby-forum.com/u/vh1)\
**Post date:** [May 19, 2008, 12:11pm UTC](https://www.ruby-forum.com/t/rake-0-8-1-command-line-parameter-problem/137943/2 "2008-05-19T12:11:00Z")

</div>

Hah. Got it. I needs :needs

Good ol’ Google…

[http://rubyforge.org/pipermail/rake-devel/2007-December/000352.html](http://rubyforge.org/pipermail/rake-devel/2007-December/000352.html)
