The Chalukya or Solanki ruler of Gujarat at the time of Mahmud of Ghazni's attack on Somnath was Bhima.
Mahmud of Ghazni was a ruler of the Ghaznavid Empire, which was a Muslim dynasty that ruled parts of present-day Afghanistan, Pakistan, and northern India in the 11th and 12th centuries. In 1025, Mahmud of Ghazni launched an attack on the city of Somnath, which was located on the western coast of India in present-day Gujarat. The city was an important center of Hindu worship and was known for its rich cultural and economic significance.
At the time of the attack, the ruler of Gujarat was Bhima, who was a member of the Chalukya or Solanki dynasty. The Chalukyas were a Hindu dynasty that ruled over parts of present-day Gujarat and Rajasthan in western India from the 10th to the 13th centuries. Bhima was known for his strong and able administration, and he successfully defended Gujarat against several invasions and attacks during his reign. However, he was unable to prevent the destruction of Somnath by Mahmud of Ghazni, and the city was plundered and its temple was razed to the ground.