'How to extract a .rar archive with Ruby?

I need to unpack an .rar archive with Ruby. I could not find a gem though.
I discovered the rar gem which only allows to create an archive. How can I extract a rar file, not just create it?



Solution 1:[1]

ffi-libarchive provides a gem-based solution. It works for rar files even though they don't specifically mention it (see issue #151). Add this to your application's Gemfile:

gem 'ffi-libarchive'

and then execute:

$ bundle

Sources

This article follows the attribution requirements of Stack Overflow and is licensed under CC BY-SA 3.0.

Source: Stack Overflow

Solution Source
Solution 1