Problem with swig & ruby

ok, so i’m working on a project that requires me to use swig to write
ruby bindings. unfortunately, when i try and run swig & i give it the
directory of ruby.h it gives me a “ruby/config.h not found” error. i’m
using rvm so i can manage the different versions i’m going to be testing
against, but that shouldnt matter as when i compiled from source it have
the same error. i can find config.h, it’s in “i686-linux/ruby” not
(relative to ruby.h). whats the deal with this? i mean i can easily
symlink or copy config.h to the proper place, but i shouldnt have to do
this. and before anyone asks i did configure with --enable-shared. is
a bug i need to talk to the head-honchos about?? i would like this
so i dont have to worry about this when i install other versions of ruby
(or asking people to do this for their version of ruby). i mean, it
of looks bad if i ask someone to symlink something for me (and yes i
do it for them in my config scripts, but the whole thing should be

thanks in advance!

no one has a good (or bad) answer to this? :-/ crap!

37 min of waiting is not that long…get yourself a coffee as a
here is my hint:

to get the right value for CPPFLAGS, call this script:

require ‘mkmf’
if RUBY_VERSION[0,3] == ‘1.8’
puts “-I#{Config::expand(CONFIG[‘rubyhdrdir’])}”
puts “-I#{Config::expand(CONFIG[‘rubyhdrdir’])}

On my system, its outpout is
-I/usr/include/ruby-1.9.1 -I/usr/include/ruby-1.9.1/x86_64-linux

Ruby uses two config.h files, one for platform independent and one for
platform dependent settings.


BTW, there a SWIG mailing list: [email protected]

This forum is not affiliated to the Ruby language, Ruby on Rails framework, nor any Ruby applications discussed here.

| Privacy Policy | Terms of Service | Remote Ruby Jobs