(0...8).map { (65 + rand(26)).chr }.join
# OYOTTDME

How to generate a random string in Ruby - Stack Overflow