Skip to content

Instantly share code, notes, and snippets.

@maccman
Created August 13, 2009 16:53
Show Gist options
  • Star 0 You must be signed in to star a gist
  • Fork 0 You must be signed in to fork a gist
  • Save maccman/167293 to your computer and use it in GitHub Desktop.
Save maccman/167293 to your computer and use it in GitHub Desktop.
// Demonstrating what's presumed to be a Ruby 1.9 bug
// Where test.rb contains:
// require 'rubygems'
// The error raised is that Mutex can't find the method 'synchronize'
#include <ruby.h>
static char ** s_argv;
static int s_argc = 1;
int main() {
s_argv = (char **) calloc(2, sizeof(char *));
s_argv[0] = "Embedded Ruby";
s_argv[1] = NULL;
ruby_sysinit(&s_argc, &s_argv);
{
RUBY_INIT_STACK;
ruby_init();
ruby_script("BrowserPlus Embedded Ruby");
ruby_init_loadpath();
rb_require("test.rb");
}
}
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment