They mean the same thing. The verb "to prefer," is one that can be followed by either the infinitive or the gerund without altering meaning. Consider these two sentences:
1) I prefer to do aerobic exercises rather than lifting weights.
2) I prefer doing aerobic exercises rather than lifting weights.
The meaning is identical. Both sentences are grammatically correct.