# Changing rake task dependencies, runs in wrong order

**URL:** <https://www.ruby-forum.com/t/changing-rake-task-dependencies-runs-in-wrong-order/84530>\
**Category:** Ruby\
**Created:** [February 5, 2007, 6:53pm UTC](https://www.ruby-forum.com/t/changing-rake-task-dependencies-runs-in-wrong-order/84530 "2007-02-05T18:53:53Z")\
**Posts on this page:** 1\
**Page:** 1

<div class="post-metadata">

**Author:** ![Trans](https://www.ruby-forum.com/letter_avatar_proxy/v4/letter/t/dfb087/32.png) [@Trans](https://www.ruby-forum.com/u/Trans)\
**Post date:** [February 5, 2007, 6:53pm UTC](https://www.ruby-forum.com/t/changing-rake-task-dependencies-runs-in-wrong-order/84530/1 "2007-02-05T18:53:53Z")

</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:

Rake::GemPackageTask.new(spec) do |pkg|  
…  
end

# Don’t show the clobber task, just always clobber when

# creating packages. Maybe in future ask to make sure.

Rake::Task[‘clobber\_package’].comment = nil  
Rake::Task[‘repackage’].comment = nil  
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.
