Internal energy of a gas

My professor says that the internal energy of a gas is the sum of its kinetic energy and potential energy: $U = E\_k + E\_p$.


It also says that the root-mean-square speed of gas molecules is $v\_{rms}=\sqrt{\frac{3RT}{M}}$. Rearranging this formula gives: $E\_k = 1/2\*M\*v\_{rms}^2=3/2\*R\*T$. 


Further, my textbook also says that the potential energy of an ideal gas is 0, because there are no attractive or repulsive forces in the gas.


Then, it seems as though the first equation becomes: $U = 3/2\*R\*T + 0 = 3/2\*R\*T$, but we know that the internal energy of an ideal gas is not always $U = 3/2\*R\*T$; it changes based on the state (constant temperature or constant pressure) and the geometry of the gas molecule (monatomic, diatomic, or nonlinear).


What am I missing?


