I asked this question at the end of class, and the teacher told me:
"They do not have the same meaning. A gerund represents any instance of an action, while an infinitive represents the concept of an action"
But, I don't undertand what he meant. I'd be thankful, if you could answer my question. Thanks.