The long-tail distribution of items is common in recommendation systems. However, due to the limited interaction records of long-tail items, recommending them to users significantly affects the model’s performance. Hence, to address this issue, recent research utilized data from popular/head items to supplement data from long-tail items, including transfer learning, meta-learning, and contrastive learning. While these methods have been effective, they still suffer from two challenges: (1) The knowledge transferred to long-tail items is not well-adapted, and (2) the feature representations of long-tail items are not accurate enough. Therefore, this paper combines graph contrastive learning and zero-shot learning to generate virtual feature representations for addressing the data sparsity problem. This novel learning scheme, GACRec, is based on a generative adversarial network (GAN) to generate virtual feature representations for long-tail items. These virtual representations train the model to obtain robust generalization ability. Specifically, graph contrastive learning firstly trains the features of popular and long-tail items. Then, the common interaction records of popular and long-tail items are extracted as shared attributes. Finally, we utilize generative adversarial zero-shot learning to generate virtual representations based on the shared attributes. These virtual representations are then used to replace the feature representations of long-tail items during model training. Through theoretical and experimental analyses, we demonstrate that GACRec improves the model’s generalization ability and recommendation accuracy. Extensive experiments on three benchmark datasets demonstrate the effectiveness of GACRec in terms of Precision, Recall, and NDCG. Furthermore, the experimental results highlight that the proposed method outperforms other comparative methods.