# Problem starting Rake in some directories

**URL:** <https://www.ruby-forum.com/t/problem-starting-rake-in-some-directories/190693>\
**Category:** Ruby\
**Created:** [June 25, 2010, 5:20am UTC](https://www.ruby-forum.com/t/problem-starting-rake-in-some-directories/190693 "2010-06-25T05:20:25Z")\
**Posts on this page:** 3\
**Page:** 1

<div class="post-metadata">

**Author:** ![rjlyders](https://www.ruby-forum.com/letter_avatar_proxy/v4/letter/r/58f4c7/32.png) [@rjlyders](https://www.ruby-forum.com/u/rjlyders)\
**Post date:** [June 25, 2010, 5:20am UTC](https://www.ruby-forum.com/t/problem-starting-rake-in-some-directories/190693/1 "2010-06-25T05:20:25Z")

</div>

Hi,

I tried to invoke rake from a Command Window, with a couple of failures  
and  
one success. I haven’t consciously done anything to my system to impact  
rake Any idea what’s going on?

First try:  
K:\>rake --trace  
rake aborted!  
No Rakefile found (looking for: rakefile, Rakefile, rakefile.rb,  
Rakefile.rb)  
K:/\_Utilities/ruby186-26\_rc2/ruby/lib/ruby/gems/1.8/gems/rake-0.8.7/lib/rake.rb:2377:in  
`raw_load_rakefile' K:/_Utilities/ruby186-26_rc2/ruby/lib/ruby/gems/1.8/gems/rake-0.8.7/lib/rake.rb:2017:in`load\_rakefile’  
K:/\_Utilities/ruby186-26\_rc2/ruby/lib/ruby/gems/1.8/gems/rake-0.8.7/lib/rake.rb:2068:in  
`standard_exception_handling' K:/_Utilities/ruby186-26_rc2/ruby/lib/ruby/gems/1.8/gems/rake-0.8.7/lib/rake.rb:2016:in`load\_rakefile’  
K:/\_Utilities/ruby186-26\_rc2/ruby/lib/ruby/gems/1.8/gems/rake-0.8.7/lib/rake.rb:2000:in  
`run' K:/_Utilities/ruby186-26_rc2/ruby/lib/ruby/gems/1.8/gems/rake-0.8.7/lib/rake.rb:2068:in`standard\_exception\_handling’  
K:/\_Utilities/ruby186-26\_rc2/ruby/lib/ruby/gems/1.8/gems/rake-0.8.7/lib/rake.rb:1998:in  
`run' K:/_Utilities/ruby186-26_rc2/ruby/lib/ruby/gems/1.8/gems/rake-0.8.7/bin/rake:31 K:/_Utilities/ruby186-26_rc2/ruby/bin/rake:19:in`load’  
K:/\_Utilities/ruby186-26\_rc2/ruby/bin/rake:19

Second try:  
K:\_Projects\Ruby\_Rails\_Apps\_EIMS\RTS\>rake --trace  
rake aborted!  
[snip: same trace]

Third try (success):  
K:\_Projects\Ruby\_Rails\_Apps\_EIMS\RTS2\>rake --trace  
(in K:/\_Projects/Ruby/\_Rails\_Apps/\_EIMS/RTS2)  
\*\* Invoke default (first\_time)  
\*\* Invoke test (first\_time)  
\*\* Execute test  
\*\* Invoke test:units (first\_time)  
\*\* Invoke db:test:prepare (first\_time)  
\*\* Invoke db:abort\_if\_pending\_migrations (first\_time)  
\*\* Invoke environment (first\_time)  
\*\* Execute environment  
\*\* Execute db:abort\_if\_pending\_migrations  
You have 1 pending migrations:  
20100624214641 CreateExpenses  
Run “rake db:migrate” to update your database then try again.

In the second attempt, there was a migration in the depths of the RTS  
directory, but rake failed instead of reporting the migration’s  
existence.  
I can’t imagine how this problem occurred.

Thanks in Advance,  
Richard

— news://freenews.netfront.net/ - complaints: removed\_email\_address@domain.invalid —

---

<div class="post-metadata">

**Author:** ![rjlyders](https://www.ruby-forum.com/letter_avatar_proxy/v4/letter/r/58f4c7/32.png) [@rjlyders](https://www.ruby-forum.com/u/rjlyders)\
**Post date:** [June 25, 2010, 5:42am UTC](https://www.ruby-forum.com/t/problem-starting-rake-in-some-directories/190693/2 "2010-06-25T05:42:40Z")

</div>

On Jun 24, 2010, at 8:20 PM, “Richard L.” [removed\_email\_address@domain.invalid](mailto:removed_email_address@domain.invalid)  
wrote:

> In the second attempt, there was a migration in the depths of the RTS  
> directory, but rake failed instead of reporting the migration’s existence.  
> I can’t imagine how this problem occurred

You changed directories between each attempt.

---

<div class="post-metadata">

**Author:** ![rjlyders](https://www.ruby-forum.com/letter_avatar_proxy/v4/letter/r/58f4c7/32.png) [@rjlyders](https://www.ruby-forum.com/u/rjlyders)\
**Post date:** [June 25, 2010, 6:04am UTC](https://www.ruby-forum.com/t/problem-starting-rake-in-some-directories/190693/3 "2010-06-25T06:04:55Z")

</div>

On Thu, Jun 24, 2010 at 10:20 PM, Richard L.  
[removed\_email\_address@domain.invalid](mailto:removed_email_address@domain.invalid)wrote:

> Rakefile.rb)  
> K:/\_Utilities/ruby186-26\_rc2/ruby/lib/ruby/gems/1.8/gems/rake-0.8.7/lib/rake.rb:2016:in
> 
> K:\_Projects\Ruby\_Rails\_Apps\_EIMS\RTS2\>rake --trace  
> You have 1 pending migrations:
> 
> — news://freenews.netfront.net/ - complaints: removed\_email\_address@domain.invalid —

Rake works by looking in your dir for a file called rakefile, Rakefile,  
rakefile.rb, or Rakefile.rb Your directory doesn’t have one, so there is  
no  
file for rake to pull in and find your tasks from.

(Think of it as being similar to how Ruby works on your file that ends  
in  
.rb)

Probably you are not in the root directory of your Rails app. Check to  
make  
sure that you are in your app’s root directory. Hint: it will have app,  
config, db, and public among others. Oh yeah, and a Rakefile 😉
