@Gargron github.com/tootsuite/mastodon/ seems to have fixed the problem in building openssl Gem on Heroku. Thanks!