It is narrated from Sayyiduna Jabir (may Allah be pleased with him) that once the Prophet (peace and blessings be upon him) was on a journey. On the way, he saw that people had gathered around a man and were shading him. Upon asking, the people informed that he was fasting. So the Prophet (peace and blessings be upon him) said: Fasting while on a journey is not an act of righteousness.
Hadith Referenceمسند احمد / مسند المكثرين من الصحابة / 14794
Hadith Gradingحکم دارالسلام:حديث صحيح، محمد بن عبدالرحمن بن أسعد بن زرارة لم يسمع من جابر ، بينهما محمد بن عمرو بن الحسن بن علي، انظر: 14193