You adhere to a noun, so a gerund would sound to me less strange than an infinitive, but still pretty odd:
He adhered to eat only rice.
He adhered to a policy of eating only rice.
He adhered to eating only rice. Some people might find it acceptable, but it sounds rather awkward to me. Why not 'He ate only rice'?
Student or Learner