Hi,
This can happen because of different reasons. E.g. something was changed in the environment, something, that is present on the first environment is absent on the second one, etc.
Considering the amount of information provided by you, I would suggest to look for the differences between your two systems and try to figure out what differences might matter.
However, the more relevant information you provide (at least - the code snippet and the line that fails) the higher are the chances to get more definite answer.