I’m trying to run a block of Ruby code inside a C program.
I have the following code:
#include <ruby.h>
int main(int argc, char* argv[])
{
/* Construct the VM */
ruby_init();
/* Ruby goes here */
/* Destruct the VM */
return ruby_cleanup(0);
}
But when I try to run the program, I get the following error:
fatal error: ruby.h: No such file or directory
#include <ruby.h>
I read that it is needed to tell the compiler about the include paths for the required headers with the following code in Ubuntu:
pkg-config --cflags --libs ruby-2.5
gcc -I/usr/include/ruby-2.5.0 -I/usr/include/ruby-2.5.0/x86_64-linux -lruby
I have already done that, but the problem isn’t solved.
Here is the link: https://silverhammermba.github.io/emberb/embed/