String#count
counts the number of occurences of (a set of) substrings in the string. In order to do this, it must compare each character against the predicate set, there is no other way.
It cannot possibly be faster than O(n). The trivial implementation is O(n), so in order to make it slower than O(n), you have to be extra stupid and do extra work. So, since it cannot be faster than O(n), and we can assume that nobody would be stupid or malicious enough to deliberately make it slower than O(n), we can safely conclude that it is O(n).
However, that is just a conclusion. It is no guarantee. The Ruby Language Specification does not make performance guarantees. But you can be pretty sure that a Ruby implementation where it is not O(n) would be ridiculed and simply not used and die.