Created
August 13, 2009 16:53
-
-
Save maccman/167293 to your computer and use it in GitHub Desktop.
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
// 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