[Rubygems-developers] Gem build process for C extension

Jeff Davis ruby at j-davis.com
Fri Jan 4 18:19:07 EST 2008

I am writing a C extension and I was using mkmf, but I had some problems
with that (described below), and so looked into mkrf which appears to
work better.


(a) How do I tell rubygems to invoke "rake" rather than "make" during
the build process? I assume I just need to put something in
the .gemspec, but I don't know what.

(b) How do I tell rubygems that my gem now has a dependency on the
"mkrf" gem?

The problem that I had with mkmf was that it would not properly quote
pathnames, so my extension couldn't be built when people had spaces in
the include paths or lib paths. It was basically impossible to work
around that in mkmf, but I was able to work around it more easily in

Are there documents or examples showing how to properly use gems in
conjunction with a C extension and its build process? How do other
people make sure path names are quoted properly? Should I use mkmf or

Is there comprehensive documentation for a .gemspec file?

	Jeff Davis

More information about the Rubygems-developers mailing list