Skip to main content
1 vote
2 answers
87 views

I have the following code here: #include <ruby.h> int main(int argc, char* argv[]) { /* construct the VM */ ruby_init(); /* Ruby goes here */ int state; VALUE result; ...
Some nerd who does not have a 's user avatar
3 votes
0 answers
182 views

I am trying to use the ruby C-api to call unpack on a ruby string. Here is my current code: #include "ruby.h" #include <stdio.h> #include <unistd.h> VALUE dangerous_func(...
Some nerd who does not have a 's user avatar
0 votes
0 answers
62 views

I'm trying to do a simple parfor loop in a Ruby c/c++ extension using openmp #pragma omp parallel for for (int j = 0; j < 100; j++) { } extconf.rb: require 'mkmf' extension_name = 'stridx' $CFLAGS ...
Sami Sieranoja's user avatar
1 vote
1 answer
89 views

I am trying to write a fuzzing harness for this open source regex library , but I am running into a problem that I do not know how to call a module in the ruby C-api properly. My current harness code ...
Some nerd who does not have a 's user avatar
0 votes
1 answer
143 views

I followed these instructions to compile ruby: https://docs.ruby-lang.org/en/master/contributing/building_ruby_md.html#label-Quick+start+guide Then I made this simple C program which uses the ruby ...
Some nerd who does not have a 's user avatar
3 votes
1 answer
117 views

I am running a ruby script through C as follows: #include <ruby.h> int main(void) { ruby_init(); int status; rb_load_protect(rb_str_new2("./test.rb"), 0, &status); if (...
Jomy's user avatar
  • 575
2 votes
1 answer
249 views

I want to call a global method in ruby from my C API code. So in ruby: def giveMeABlock(*args) puts "Starting giveMeABlock with #{args.inspect}" yield if block_given? end As I've since ...
David Ljung Madison Stellar's user avatar
1 vote
1 answer
62 views

I was trying to implement a project using Ruby's C API which led me to the following problem. I have a script that requires the Singleton module and noticed that my program always crashes, so I boiled ...
derschueddi's user avatar
0 votes
1 answer
280 views

I am trying to work with libcsv here. The header file csv.h is in /usr/include directory, and the shared library file libcsv.so in /usr/lib64 (Fedora 35). For now, I was able to make the gem file work ...
user avatar
1 vote
1 answer
221 views

I have a Ruby C extension; I call that class FooC defined in ext/foo/foo.c, in that file I have void Init_foo(void) { VALUE cFoo = rb_const_get(rb_cObject, rb_intern("FooC")); : ...
jjg's user avatar
  • 1,120
1 vote
0 answers
267 views

I've been trying to debug ruby gem made with Ruby C Extension to figure out how it works, so I can modify it to my own use. It's quite an advanced gem and printing values isn't enough. So I started ...
railsmk's user avatar
  • 23
0 votes
1 answer
345 views

I'm trying to build the ruby-odbc gem from source to debug an issue. I can successfully compile odbc.so and odbc_utf8.so, but when I include the gem in my Gemfile via :path I get "incompatible ...
ioev's user avatar
  • 98
0 votes
1 answer
63 views

I create an extension for Ruby in C and I am currently struggling with calling constructor on class I defined also in C. Code for class definition is called before the class is being used. I am trying ...
dom's user avatar
  • 444
0 votes
1 answer
164 views

I'm writing a Ruby C extension, and need to call rb_raise() and pass it a char *. I also need to free that given char *. My current behavior won't free anything, and another approach I've tried lead ...
Ulysse BN's user avatar
  • 11.7k
2 votes
0 answers
50 views

I've been working on some ruby libraries with C extensions now. And I want to give users access to the irb#help method, e.g: > help("Array#empty?") # Prints documentation for the method. ...
Ulysse BN's user avatar
  • 11.7k

15 30 50 per page
1
2 3 4 5
13