Double check your private key. As detailed in the error message it was EC and not RSA.
Editing a single line would solve your issue:
client_key = OpenSSL::PKey::EC.new(File.read('/root/client/client.key'), keypass)