Right now we are using BEGIN { } blocks in a lot of C4, including for database access in C4::Context. This means that any script that uses C4::Context, even if it doesn't actually need the database or is not being run, just compiled, will not function without a database present.
This was no longer valid. See also related bug 27246. *** This bug has been marked as a duplicate of bug 27246 ***