Ruby Inline is an analog to Perl's Inline::C. Out of the box, it allows you to embed C/++ external module code in your ruby script directly. By writing simple builder classes, you can teach how to cope with new languages (fortran, perl, whatever). The code is compiled and run on the fly when needed. Using the package_inline tool Inline allows you to package up your inlined object code for distribution to systems without a compiler.
Gemfile gem 'RubyInline', '~> 3.6.7'
install gem install RubyInline -v 3.6.7