Skip initialization when a db connection is unavailable

Play nicely when namespaces are eagerly loaded and a database is unavailable. Ran into this when precompiling assets in a db-less environment.