I\'ve have a Rails app that loads a number of RSA certificates before a transaction is made with Paypal. On my development machine, these certificates are read from files in
My answer comes a bit late but I had the same issue recently with multi-line env. variables on Heroku.
My solution was to use strict_encode64:
encoded_secret = Base64.strict_encode64("my_multi_line_secret")
add the key:
$ heroku config:set SECRET_KEY='the encoded_secret string here'
In the code, you then decode it using Base64.strict_decode64(ENV['SECRET_KEY'])