How to create and debug Ruby gem with C (native) extension
This article explains how to create a minimum Ruby gem with native extension written in C and debug it with gdb.
I uploaded complete code to GitHub.
Tested with:
Ubuntu 20.04 (with self-built Linux kernel 5.11.22+) Ruby 2.7.4 Warning Using Ruby version 2.7.4 is strongly recommended at the first time of doing this tutorial. I think making Ruby-C-extensions has a high probability of encountering errors – for instance, as of 2021-08-14, with Ruby 3.