# Abort Rake Task

**URL:** <https://www.ruby-forum.com/t/abort-rake-task/47784>\
**Category:** Ruby\
**Created:** [November 13, 2005, 11:14pm UTC](https://www.ruby-forum.com/t/abort-rake-task/47784 "2005-11-13T23:14:29Z")\
**Posts on this page:** 1\
**Page:** 1

<div class="post-metadata">

**Author:** ![brian.takita](https://www.ruby-forum.com/letter_avatar_proxy/v4/letter/b/85f322/32.png) [@brian.takita](https://www.ruby-forum.com/u/brian.takita)\
**Post date:** [November 13, 2005, 11:14pm UTC](https://www.ruby-forum.com/t/abort-rake-task/47784/1 "2005-11-13T23:14:29Z")

</div>

Hello,

I have a rake task named setup, that depends on a file task that  
creates a yml file that has the path to ruby on the system. I would  
like setup to abort if the file is created and tell the user to edit  
the yml file to the actual ruby path.

So far, the only way I can think of to do it is using the exit method.

However I get the following message:  
$ rake setup  
(in /cygdrive/c/dev/ruby/project)  
property ‘svn:ignore’ set on ‘.’  
Please edit the ruby\_env.yml file with the path to ruby on your system.  
Then run ‘rake setup’ again.  
rake aborted!  
exit  
…/rakefile:37:in `exit’

However, the last three lines look like an error and would probably be  
confusing to the user.

Is there a more elegant way to do this in rake?

Thank you,  
Brian T.
