use Base64.strict_encode64

it turned out that 2.2.15 does not like new line in encoded strings.