We define sets with finitely ramified cell structure, which are generalizations of post-critically finite self-similar sets introduced by Kigami and of fractafolds introduced by Strichartz. In general, we do not assume even local self-similarity, and allow countably many cells connected at each junction point. In particular, we consider post-critically infinite fractals. We prove that if Kigami’s resistance form satisfies certain assumptions, then there exists a weak Riemannian metric such that the energy can be expressed as the integral of the norm squared of a weak gradient with respect to an energy measure. Furthermore, we prove that if such a set can be homeomorphically represented in harmonic coordinates, then for smooth functions the weak gradient can be replaced by the usual gradient. We also prove a simple formula for the energy measure Laplacian in harmonic coordinates.