这是雷神任务:
desc 'readkeys', 'Read keys'
method_option :password, :type => :string, :desc => 'Password for the key store'
def readkeys
if options[:password].nil?
puts "Enter keystore password"
options[:password] = gets
end
File.open("#{Dir.home}#{File::SEPARATOR}#{ENV['USER']}.p12") do |p12|
pkcs12 = OpenSSL::PKCS12.new(p12.read, options[:password])
end
end
当我运行命令时,我收到此错误:
./mycommand:26:in `gets': 没有这样的文件或目录 - readkeys (Errno::ENOENT)
有任何想法吗?语法似乎很好。