Gitorious setup: RSTRING_LEN in rdiscount

Ran into an issue recently where I was trying to install gitorious on a local RHEL5 system. The site would crash every time I tried to view a repo with the error:

ruby: symbol lookup error: /usr/lib64/ruby/gems/1.8/gems/rdiscount-1.3.1.1/lib/rdiscount.so: undefined symbol: RSTRING_LEN

The solution ended up being the following – In the file /usr/lib64/ruby/1.8/x86_64-linux/ruby.h ( note I’m running on 64bit, on 32bit it’d be /usr/lib/ruby/1.8/i386-linux/ ), add these lines somewhere near the top:

#define RSTRING_LEN(s) (RSTRING(s)->len)
#define RSTRING_PTR(s) (RSTRING(s)->ptr)

After that, uninstall and reinstall rdiscount

gem uninstall rdiscount
gem install rdiscount -v 1.3.1.1

And you should be good to go.

There are no comments, yet.

Why don’t you be the first? Come on, you know you want to!

Leave a Comment