[Rubygems-developers] Gem build process for C extension

Jeremy Hinegardner jeremy at hinegardner.org
Fri Jan 4 23:07:57 EST 2008

On Fri, Jan 04, 2008 at 07:43:38PM -0800, Jeff Davis wrote:
> On Fri, 2008-01-04 at 18:54 -0800, Kevin Clark wrote:
> > > (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.
> > 
> > If you have a Rakefile or a mkrf_config in the ext directory, it
> > should use those instead of an extconf.
> Doesn't extconf.rb (using mkrf) generate the Rakefile? I don't bundle a
> Makefile or a Rakefile. After extconf.rb is run, the Rakefile is
> perfect, but I don't think "gem install" is running "rake", because it
> fails.

Yup that is what is happening, it is running 'make' and there is no
Makefile present.

When rubygems looks to install your extension it has to decide how to do
it.  An extconf.rb file says to use the mkmf method which is:

    ruby extconf.rb

and a mkrf_conf file says to use the mkrf method which is:

    ruby mkrf_conf.rb



 Jeremy Hinegardner                              jeremy at hinegardner.org 

More information about the Rubygems-developers mailing list