1

On my Desktop Debian GNU/Linux 9.11 (stretch) the code works but not on a server Ubuntu 16.04.6

The problem occures in the method Function: gpgme_error_t gpgme_op_decrypt (gpgme_ctx_t ctx, gpgme_data_t cipher, gpgme_data_t plain) https://www.gnupg.org/documentation/manuals/gpgme/Decrypt.html

crypto = GPGME::Ctx.new(
      pinentry_mode: GPGME::PINENTRY_MODE_LOOPBACK,
      passphrase_callback: method(:passfunc)
    )
    data = crypto.decrypt(encrypted_data)

raises exception GPGME::Error with message 'Not supported'

The error occurs in the GEM shared/bundle/ruby/2.5.0/gems/gpgme-2.0.18/lib/gpgme/ctx.rb:428:in `decrypt'

 def decrypt(cipher, plain = Data.new)
      err = GPGME::gpgme_op_decrypt(self, cipher, plain)

The exception GPGME::Error with message 'Not supported' is not documented at https://www.rubydoc.info/gems/gpgme/2.0.18/GPGME/Error

On my development PC the exception is not raised!

1 Answers1

0

The GPGME README says: To build GPGME you need to install libgpg-error (>= 1.24) and libassuan (>= 2.4.2).

On Ubuntu 16.04.6 I do not find libgpg-error (>= 1.24)

Workaround, execute a command line GPG command:

`export GPG_TTY=$(tty) && echo "#{passphrase]}" | gpg --yes --passphrase-fd 0 --output #{out_path} --decrypt #{in_path}`

Unfortunately in my case GPG made easy was not easy