[Rubygems-developers] rake build task

James Tucker jftucker at gmail.com
Mon Nov 10 21:00:41 EST 2008

Hey folks,

I need to send a patch [1], but, I don't think that's quite right yet,  
so until I try and grok why the test still pass, I have some  

First of all, I note that gem19 install rake will install rake to  
rake19, and so on. This means the above patch is still wrong under  
those conditions.

How do I find out the correct prefix from rubygems?

Regarding the above patch, it solves an issue when building the new  
eventmachine rake build gem, under conditions that rake is being  
invoked from jruby -S gem install gemname. The prior code would invoke  
'rake' from the path, which would lead in some configurations to the  
MRI install. Whilst rake is pretty common, what we do in the gem is  

Rakefile#L38-39   (ruby_platform =~ java)

In order to allow for a common gem, which will build on a number of  
ruby platforms:


Another slight aside, but interesting, is how I went about dealing  
with the fact that we don't currently supply args to rake builds:


Thanks in advance,


 From a009f31f8a21313332359644e36db5f431f8bf6a Mon Sep 17 00:00:00 2001
From: raggi <jftucker at gmail.com>
Date: Tue, 11 Nov 2008 00:30:48 +0000
Subject: [PATCH] Added a fix for rake path search

  lib/rubygems/ext/rake_builder.rb |    2 +-
  1 files changed, 1 insertions(+), 1 deletions(-)

diff --git a/lib/rubygems/ext/rake_builder.rb b/lib/rubygems/ext/ 
index 0c64e61..0f5f629 100644
--- a/lib/rubygems/ext/rake_builder.rb
+++ b/lib/rubygems/ext/rake_builder.rb
@@ -15,7 +15,7 @@ class Gem::Ext::RakeBuilder < Gem::Ext::Builder
        run cmd, results

-    cmd = ENV['rake'] || 'rake'
+    cmd = ENV['rake'] || "#{Gem.ruby} -S rake"
      cmd += " RUBYARCHDIR=#{dest_path} RUBYLIBDIR=#{dest_path}" # ENV  
is frozen

      run cmd, results

More information about the Rubygems-developers mailing list