The [Ruby lexer](https://github.com/geany/geany/blob/ea649d8024b14ce55a922e146078ad1bc15533df...) that Geany uses from [the Scintilla project](https://www.scintilla.org/) for highlighting doesn't support embedding Ruby in HTML or vice versa.
If anyone wants to contribute this enhancement to Scintilla, we could update Geany's Ruby (or HTML) filetype to support it once it's merged upstream.