I’m writing a ruby wrapper for a proprietary api. I compiled it, but
when I
require it in irb i get the following error. I’m stumped as to why its
throwing this error. Anyone help?
irb(main):001:0> require ‘metadata’
LoadError: ./metadata.so: failed to map segment from shared object:
Operation not permitted - ./metadata.so
from ./metadata.so
from (irb):1
=cut
#include <ruby.h>
#include “mdc.h”
/* Module and class names */
static VALUE md_mMetadata;
static VALUE md_cClientAPI;
VALUE
md_initialize(int argc, VALUE *argv, VALUE self)
{
VALUE login, password, server, table_name, table_version;
rb_scan_args(argc, argv, "41", &login, &password, &server,
&table_name, &table_version);
if(NIL_P(table_version)) {
rb_iv_set( self, "@table_version", Qnil );
}
rb_iv_set(self, "@login", rb_funcall(login, rb_intern("to_s"), 0)
);
rb_iv_set(self, “@password”, rb_funcall(password,
rb_intern(“to_s”),
0) );
rb_iv_set(self, “@server”, rb_funcall(server, rb_intern(“to_s”),
0) );
rb_iv_set(self, "@table_name", rb_funcall(table_name,
rb_intern(“to_s”),0) );
return self;
}
void Init_metadata() {
md_mMetadata = rb_define_module(“Metadata”);
md_cClientAPI = rb_define_class_under(md_mMetadata, “ClientAPI”,
rb_cObject);
rb_define_method(md_cClientAPI, “initialize”, md_initialize, 4);
}