# Changing rake task dependencies, runs in wrong order

**URL:** <https://rubytalk.org/t/changing-rake-task-dependencies-runs-in-wrong-order/35089>\
**Category:** ruby-talk\
**Created:** [5 February 2007 17:52 UTC](https://rubytalk.org/t/changing-rake-task-dependencies-runs-in-wrong-order/35089 "2007-02-05T17:52:54Z")\
**Posts on this page:** 1\
**Page:** 1

<div class="post-metadata">

**Author:** ![7rans](https://avatars.discourse-cdn.com/v4/letter/7/a8b319/32.png) [@7rans](https://rubytalk.org/u/7rans)\
**Post date:** [5 February 2007 17:52 UTC](https://rubytalk.org/t/changing-rake-task-dependencies-runs-in-wrong-order/35089/1 "2007-02-05T17:52:54Z")

</div>

I'm confused. I'm trying to alter the dependencies of a premade rake  
task, and while it accepts it, it's actully running the dependcy after  
the task rather than before it. With this:

&nbsp;&nbsp;Rake::GemPackageTask.new(spec) do |pkg|  
&nbsp;&nbsp;&nbsp;&nbsp;...  
&nbsp;&nbsp;end

&nbsp;&nbsp;# Don't show the clobber task, just always clobber when  
&nbsp;&nbsp;# creating packages. Maybe in future ask to make sure.  
&nbsp;&nbsp;Rake::Task['clobber\_package'].comment = nil  
&nbsp;&nbsp;Rake::Task['repackage'].comment = nil  
&nbsp;&nbsp;task :package =\> [:clobber\_package]

Shouldn't it invoke clobber\_package BEFORE package? I ran it with --  
trace and it's clearly doing the opposite. What's up?

Thanks,  
T.
