RAR libraries for Ruby
For Ruby, ffi-libarchive is the practical choice. It’s an FFI binding to the C library libarchive, so it reads RAR4 and RAR5 with the same code that reads ZIP, 7z and TAR. It inherits libarchive’s limits for RAR: no encrypted archives, no solid RAR4 archives and no volumes. It needs the libarchive shared library installed on the system.
For encrypted or multi-volume RAR files, run the unrar or 7z command line tool from Ruby instead.
- ffi-libarchive ffi-libarchive is a Ruby binding to libarchive that reads RAR4 and RAR5 archives. How to install it, list and extract RAR files and read entries into memory.