Smiles substring matching and molecular formula searches could be handled by usingrdkit, although this unfortunately only has Python, Java, and C# bindings.
In theory, Ruby bindings could be built by using SWIG, in a similar way to the Java ones. I don't know how easy this would be to do.
It would be useful to be able to search by: