Install ruby-magic by entering the following commands in the terminal:
sudo apt update sudo apt install ruby-magic
Description:
Ruby FFI bindings to libmagic
This package provides a Ruby FFI wrapper to the "magic" library that determines content type and encoding of files and strings. The library does three types of tests: file system tests, magic number tests, and language tests. The first test that succeeds causes the file type to be returned.
Homepage: https://github.com/qoobaa/magic
Version: 0.2.9-1
Section: universe/ruby