[Rake-devel] Rakelib tasks not found

Ed Howland ed.howland at gmail.com
Mon May 8 13:54:51 EDT 2006


Not sure if this is the correct place to submit a bug to Rake or not.

I had a problem with Rake not seeing my .rake tasks in rakelib/ where
rakelib/ was in the same directory as my Rakefile and that was the
directory I was in when I executed Rake. I remember this working
previously, but not at the moment.

I hacked around in the lib/rake.rb file and on line 1817 is the
load_rakefile method.  On ~line 1830 is Dir["#{rlib}/*.rake"].each do
|name| add_import name end

This Dir doesn't always look in the current dir for some reason. I
added Dir["#{here}/#{rlib}/*.rake"] and it always works now. I can't
duplicate this in every case.

I think the problem is that I have a need to chdir inside my
PackageTask.new. I added code to save the current dir via Dir.pwd and
then chdir it back at the end of the proc. It works now.

But would adding #{here} to the .rake Dir line make some sense? Make
it safer perhaps?

I am using Rake 0.7.1 on Ruby 1.8.4 on Ubuntu 5.10 (Breezy).


More information about the Rake-devel mailing list