diff options
Diffstat (limited to 'lib/rubygems/ext')
-rw-r--r-- | lib/rubygems/ext/builder.rb | 2 | ||||
-rw-r--r-- | lib/rubygems/ext/rake_builder.rb | 12 |
2 files changed, 11 insertions, 3 deletions
diff --git a/lib/rubygems/ext/builder.rb b/lib/rubygems/ext/builder.rb index 89242aff08..29d5af5b12 100644 --- a/lib/rubygems/ext/builder.rb +++ b/lib/rubygems/ext/builder.rb @@ -28,7 +28,7 @@ class Gem::Ext::Builder File.open('Makefile', 'wb') {|f| f.print mf} - # try to find make program from Ruby configue arguments first + # try to find make program from Ruby configure arguments first RbConfig::CONFIG['configure_args'] =~ /with-make-prog\=(\w+)/ make_program = $1 || ENV['make'] unless make_program then diff --git a/lib/rubygems/ext/rake_builder.rb b/lib/rubygems/ext/rake_builder.rb index d3b5cba75c..ba9fa8a94c 100644 --- a/lib/rubygems/ext/rake_builder.rb +++ b/lib/rubygems/ext/rake_builder.rb @@ -25,8 +25,16 @@ class Gem::Ext::RakeBuilder < Gem::Ext::Builder # Deal with possible spaces in the path, e.g. C:/Program Files dest_path = '"' + dest_path + '"' if dest_path.include?(' ') - cmd = ENV['rake'] || "\"#{Gem.ruby}\" -rubygems #{Gem.bin_path('rake')}" rescue Gem.default_exec_format % 'rake' - cmd += " RUBYARCHDIR=#{dest_path} RUBYLIBDIR=#{dest_path}" # ENV is frozen + rake = ENV['rake'] + + rake ||= begin + "\"#{Gem.ruby}\" -rubygems #{Gem.bin_path('rake')}" + rescue Gem::Exception + end + + rake ||= Gem.default_exec_format % 'rake' + + cmd = "#{rake} RUBYARCHDIR=#{dest_path} RUBYLIBDIR=#{dest_path}" # ENV is frozen run cmd, results |