I need to unzip the .rar archive using Ruby. I could not find the stone. I discovered rar gem which allows you to create an archive.
I messed up unrar , which can be installed via gem 'unrar', git: ' git@github.com :aileron/unrar.git' . Here is an approximate sketch of its use ...
require 'unrar' archive = Unrar.new('test.rar') file_id = archive.list_contents.first[:filename] File.open('output-name', 'w') { |file| file.write(archive.extract(file_id)) }
source share