For the following code I get the output: “Error: /usr/local/bundle/ruby/3.0.0/gems/mitie-0.2.1/vendor/libmitie.so: cannot open shared object file: No such file or directory”, but the file does exist, and seems to be a valid ELF binary (I did my best to verify with realelf
).
In Ruby
Fiddle.dlopen("/usr/local/bundle/ruby/3.0.0/gems/mitie-0.2.1/vendor/libmitie.so")
In C
#include <stdio.h>
#include <dlfcn.h>
int main(void) {
void *handle = dlopen("/usr/local/bundle/ruby/3.0.0/gems/mitie-0.2.1/vendor/libmitie.so", RTLD_NOW);
const char *err = dlerror();
if (handle && !err) {
printf("Handle: %ld\n", (long int)handle);
}
else {
printf("Error: %s", err);
}
return 0;
}
Any thoughts? Thank you so much!
I should also note that this is running in a Docker container in a Debian based image.