Here is a simple module for generating correctly signed tickets for use with the mod_auth_pubtkt Apache module, pretty basic stuff but usefully abstracts the OpenSSL complications.
Matt Haynes
gem "mod-auth-pubtkt-rb", "~> 0.0.4"