⚠️ Archived Post
This is an archived post from my previous blog (2007-2014). It may contain outdated information, broken links, or deprecated technical content. For current writing, please see the main Writing section.

Rake: "no such file to load" although it exists

Originally published on May 26, 2009

I’m working on a search extension for the Radiant CMS that uses Xapian at the moment. I ran into a weird issue where rake complained about not being able to load a file although it existed. It listed the full - and correct - path of the rake file I wanted to include in another rake file and aborted with “no such file to load”. Lies! All lies! Reading the RDoc of Rake revealed that dependencies loaded with “require” are loaded before the Rake targets are evaluated. So alternatively you can use the “import” statement instead of “require”. That’s what solved my problem. The “no such file to load” error is quite misleading, though.