I'm trying to use the encrypt method. When I call JWE.encrypt it throws the error
(undefined method `public_encrypt' for #<String:0x00007f8fa78b75c0>)
require 'json'
require 'open-uri'
require 'jwe'
URL = 'https://gist.githubusercontent.com/.../my_json_file.json'.freeze
KEY = "-----BEGIN RSA PRIVATE KEY-----
...
-----END RSA PRIVATE KEY-----".freeze
data = JSON.load(open(URL))
encrypted = JWE.encrypt(JSON.dump(data), KEY)
puts encrypted
IO.popen('pbcopy', 'r+') { |clipboard| clipboard.puts encrypted }