# Recursive Rake rules with multiple pre-requisites

**URL:** <https://www.ruby-forum.com/t/recursive-rake-rules-with-multiple-pre-requisites/97673>\
**Category:** Ruby\
**Created:** [July 9, 2006, 1:10pm UTC](https://www.ruby-forum.com/t/recursive-rake-rules-with-multiple-pre-requisites/97673 "2006-07-09T13:10:41Z")\
**Posts on this page:** 1\
**Page:** 1

<div class="post-metadata">

**Author:** ![ToRA](https://www.ruby-forum.com/letter_avatar_proxy/v4/letter/t/3ab097/32.png) [@ToRA](https://www.ruby-forum.com/u/ToRA)\
**Post date:** [July 9, 2006, 1:10pm UTC](https://www.ruby-forum.com/t/recursive-rake-rules-with-multiple-pre-requisites/97673/1 "2006-07-09T13:10:41Z")

</div>

Hi,

I’m having a problem getting rake to work using rules that are  
recursive and have multiple prerequisites…I’ve got my problem down to  
a fairly simple example, at the bottom of the post.

If I run it, (assuming a lib directory exists) I get:  
$rake  
(in /tmp)  
rake aborted!  
Don’t know how to build task ‘blah’

(See full trace by running task with --trace)

but commenting out either of the two procs marked at #1 or #2, it can  
build.

Any ideas / suggestions or is it a bug?

Cheers,

Tris

$rake --version  
rake, version 0.7.1

$cat rakefile  
require ‘rake/clean’

CLEAN.include ‘aa’  
CLEAN.include ‘bb’  
CLEAN.include ‘cc’  
CLEAN.include ‘lib/map.o’

task :default =\> “blah”

rule(/lib/.\*.o$/ =\> [ proc { |x| ‘aa’ },  
proc { |x| ‘bb’ }]) do |t|  
sh %{touch #{t.name}}  
end

rule(/blah/ =\> [ proc { |x| ‘cc’}, #1  
proc { |x| ‘lib/map.o’ } #2  
]) do |t|  
end

file ‘cc’ do  
sh %{touch ‘cc’}  
end

file ‘aa’ do  
sh %{touch ‘aa’}  
end

file ‘bb’ do  
sh %{touch ‘bb’}  
end
