# Can not Rake :), please help

**URL:** <https://www.ruby-forum.com/t/can-not-rake-please-help/107073>\
**Category:** Ruby\
**Created:** [June 17, 2007, 7:03pm UTC](https://www.ruby-forum.com/t/can-not-rake-please-help/107073 "2007-06-17T19:03:47Z")\
**Posts on this page:** 3\
**Page:** 1

<div class="post-metadata">

**Author:** ![ozizus](https://www.ruby-forum.com/letter_avatar_proxy/v4/letter/o/ac8455/32.png) [@ozizus](https://www.ruby-forum.com/u/ozizus)\
**Post date:** [June 17, 2007, 7:03pm UTC](https://www.ruby-forum.com/t/can-not-rake-please-help/107073/1 "2007-06-17T19:03:47Z")

</div>

Hi, I dont get what is wrong with this rakefile:

#====================================  
task :default =\> :TTList

checkfile = “arrangement0/list.txt”  
task :TTList =\> checkfile do  
regenarate  
end  
#===================================

So, regenarate function regenarates bunch of files, including the  
checkfile. When I call rake, it should run :TTList task, but only if  
checkfile is not there. This rakefile runs :TTList even if the  
checkfile exists.

thx.

---

<div class="post-metadata">

**Author:** ![ozizus](https://www.ruby-forum.com/letter_avatar_proxy/v4/letter/o/ac8455/32.png) [@ozizus](https://www.ruby-forum.com/u/ozizus)\
**Post date:** [June 18, 2007, 8:08pm UTC](https://www.ruby-forum.com/t/can-not-rake-please-help/107073/2 "2007-06-18T20:08:54Z")

</div>

On 6/17/07, ozizus [removed\_email\_address@domain.invalid](mailto:removed_email_address@domain.invalid) wrote:

> #===================================
> 
> So, regenarate function regenarates bunch of files, including the  
> checkfile. When I call rake, it should run :TTList task, but only if  
> checkfile is not there. This rakefile runs :TTList even if the  
> checkfile exists.

I think you probably want:

task :default =\> checkfile

checkfile = “arrangement0/list.txt”  
file checkfile do  
regenarate  
end

AFAIK tasks are more like functions, dependent on other tasks, which  
must be  
done first. ‘file’ creates a file task, which will run in order to  
create  
that target (checkfile).  
If you want checkfile to be dependant on other files:

file checkfile =\> [depfile1, depfile2] do  
regenarate  
end

For more info, go through the tutorial:  
[http://onestepback.org/articles/buildingwithrake/filetasks.html](http://onestepback.org/articles/buildingwithrake/filetasks.html)

PS: regenerate, not regenarate

Les

thx.

---

<div class="post-metadata">

**Author:** ![ozizus](https://www.ruby-forum.com/letter_avatar_proxy/v4/letter/o/ac8455/32.png) [@ozizus](https://www.ruby-forum.com/u/ozizus)\
**Post date:** [June 18, 2007, 7:16pm UTC](https://www.ruby-forum.com/t/can-not-rake-please-help/107073/3 "2007-06-18T19:16:43Z")

</div>

On 6/17/07, ozizus [removed\_email\_address@domain.invalid](mailto:removed_email_address@domain.invalid) wrote:

> So, regenarate function regenarates bunch of files, including the  
> checkfile. When I call rake, it should run :TTList task, but only if  
> checkfile is not there. This rakefile runs :TTList even if the  
> checkfile exists.

If I recall correctly, it works the other way around. You’re defining  
the checkfile as a pre-requisite of TTList, so it would only run if  
the checkfile was already present. If you remove it, does TTList run?
