"Ruler" by definition doesn't work here. See these dictionaries...
https://www.merriam-webster.com/dictionary/ruler : a person (as a king or queen) having supreme power over a nation.
https://dictionary.cambridge.org/dictionary/english/ruler ruler meaning, definition, what is ruler: the leader of a county
https://www.thefreedictionary.com/ruler One, such as a monarch or dictator, that rules or governs
However, in this case, we mean the "leader of the government" It's the government that rules.
Better synonmys are: leader, chief, captain, commander etc...