Mechanical metamaterials are often designed with particular properties for specific load-bearing functions. Alternatively, this study aims to create a class of active lattice metamaterials, dubbed self-activated solids, that can learn desired stiffness tensors from the elastic deformations they experienced, a crucial feature to improve the performance, efficiency, and functionality of materials. Artificial adaptive matters that combine sensory, control, and actuation elements can offer appealing solutions. However, challenges still remain: The designs will rely on accurate off-line and global computations, as well as intricate coordination among individual elements. Here, a simple online and local learning strategy is initiated based on contrastive Hebbian learning to gradually guide self-activated solids to possess sought-after stiffness tensors autonomously and reversibly. During learning, the bond stiffness of the active lattice varies depending only on its local strain. The numerical tests show that the self-activated solid can not only achieve the desired bulk, shear, and coupling moduli but also manifest uni-mode and bi-mode extremal materials by itself after experiencing the corresponding elastic deformations. Further, the self-activated solid can also achieve the desired time-varying moduli when exposed to temporally different loads. The design is applicable to any lattice geometries and is resistant to damage and instabilities. The material design approach and the physical learning strategy suggested can benefit the design of autonomous materials, physical learning machines, and adaptiverobots.