Thanks to the line-of-sight (LoS) transmission and flexibility, unmanned aerial vehicles (UAVs) effectively improve the throughput of wireless networks. Nevertheless, the LoS links are prone to severe deterioration by complex propagation environments, especially in urban areas. Reconfigurable intelligent surfaces (RISs), as a promising technique, can significantly improve the propagation environment and enhance communication quality by intelligently reflecting the received signals. Motivated by this, the joint UAV trajectory and RISs passive beamforming design for a novel RIS-assisted UAV communication system is investigated to maximize the average achievable rate in this letter. To tackle the formulated non-convex problem, we divide it into two subproblems, namely, passive beamforming and trajectory optimization. We first derive a closed-form phase-shift solution for any given UAV trajectory to achieve the phase alignment of the received signals from different transmission paths. Then, with the optimal phase-shift solution, we obtain a suboptimal trajectory solution by using the successive convex approximation (SCA) method. Numerical results demonstrate that the proposed algorithm can considerably improve the average achievable rate of the system.