Ruby GPGME::Error> Inappropriate ioctl for device

2.3k views Asked by At

I'm unable to import a key file. I'm using ruby 1.9.3 and ruby-gpgme https://github.com/ueno/ruby-gpgme

require "gpgme"

begin
  key = GPGME::Key.import(File.open("private.key"), {:password => "redacted"})

rescue GPGME::Error => g
  puts g.inspect
  puts g.message
  puts g.code
  puts g.source
end

Output

Inappropriate ioctl for device

More info: /usr/local/opt/rbenv/versions/1.9.3-p392/lib/ruby/gems/1.9.1/gems/gpgme-2.0.2/lib/gpgme/ctx.rb:43:in new': Inappropriate ioctl for device (GPGME::Error) from /usr/local/opt/rbenv/versions/1.9.3-p392/lib/ruby/gems/1.9.1/gems/gpgme-2.0.2/lib/gpgme/key.rb:120:inimport' from gpgme.rb:17:in `'

Here is the ctx.rb file, but I don't get what could be causing the issue... https://github.com/ueno/ruby-gpgme/blob/master/lib/gpgme/ctx.rb

1

There are 1 answers

0
user2012677 On BEST ANSWER

The error was a result of some issue with gpgme. So I reinstalled gpgme. I used "brew gpgme". now it seems to be working.