Ruby GPGME::Ctx解密>;不支持GPGME::错误
在我的桌面Debian GNU/Linux 9.11(stretch)上,代码可以工作,但在Ubuntu 16.04.6服务器上不能工作 问题出现在方法中 功能:gpgme_error_t gpgme_op_decrypt(gpgme_ctx_t ctx,gpgme_data_t cipher,gpgme_data t plain)Ruby GPGME::Ctx解密>;不支持GPGME::错误,ruby,ruby-on-rails-4,encryption,ubuntu-16.04,gpgme,Ruby,Ruby On Rails 4,Encryption,Ubuntu 16.04,Gpgme,在我的桌面Debian GNU/Linux 9.11(stretch)上,代码可以工作,但在Ubuntu 16.04.6服务器上不能工作 问题出现在方法中 功能:gpgme_error_t gpgme_op_decrypt(gpgme_ctx_t ctx,gpgme_data_t cipher,gpgme_data t plain) crypto=GPGME::Ctx.new( pinentry_模式:GPGME::pinentry_模式_环回, 密码短语_回调:方法(:passfunc) )
crypto=GPGME::Ctx.new(
pinentry_模式:GPGME::pinentry_模式_环回,
密码短语_回调:方法(:passfunc)
)
数据=加密解密(加密数据)
引发异常GPGME::错误,消息为“不受支持”
错误发生在GEM中
shared/bundle/ruby/2.5.0/gems/gpgme-2.0.18/lib/gpgme/ctx.rb:428:在“解密”中
def decrypt(密码,plain=Data.new)
err=GPGME::GPGME_op_decrypt(self,cipher,plain)
未在中记录带有消息“不受支持”的异常GPGME::错误
在我的开发PC上,不会引发异常 GPGME自述说明:要构建GPGME,您需要安装libgpg error(>=1.24)和 利巴苏(>=2.4.2) 在Ubuntu 16.04.6上,我没有发现libgpg错误(>=1.24) 解决方法,执行命令行GPG命令:
`export GPG_TTY=$(TTY)和&echo“#{passphrase]}”GPG--yes--passphrase fd 0--output#{out_path}--decrypt#{in_path}`
不幸的是,在我的例子中,GPG变得容易并不容易,GPGME自述说明:要构建GPGME,您需要安装libgpg error(>=1.24)和 利巴苏(>=2.4.2) 在Ubuntu 16.04.6上,我没有发现libgpg错误(>=1.24) 解决方法,执行命令行GPG命令:
`export GPG_TTY=$(TTY)和&echo“#{passphrase]}”GPG--yes--passphrase fd 0--output#{out_path}--decrypt#{in_path}`
不幸的是,在我的情况下,GPG变得容易并不容易