Hi Veronica,
To avoid cramps you should keep your body well hydrated and keep on having sips of water in between of cycling as dehydration can lead to cramps. Again, dont forget to do stretching and warm up before cycling as stretching can help to improve the flexibility of your lower body muscles and warm up exercises would help your lower body to get ready for intense training and thus also improves blood supply.