[Rubygems-developers] [ rubygems-Bugs-25734 ] Gem::Ext::RakeBuilder fails under windows if ENV['rake'] not set

noreply at rubyforge.org noreply at rubyforge.org
Fri May 1 05:26:10 EDT 2009


Bugs item #25734, was opened at 2009-04-30 00:05
You can respond by visiting: 
http://rubyforge.org/tracker/?func=detail&atid=575&aid=25734&group_id=126

Category: `gem install` command
Group: None
>Status: Open
Resolution: Accepted
Priority: 3
Submitted By: Paolo Angelini (pablito)
Assigned to: James Tucker (raggi)
Summary: Gem::Ext::RakeBuilder fails under windows if ENV['rake'] not set

Initial Comment:
line 22 of rake_builder.rb builds a rake command and defaults to Gem.bin_path('rake') if ENV['rake'] is not set:
cmd = ENV['rake'] || Gem.bin_path('rake') rescue Gem.default_exec_format % 'rake'

unfortunately under windows Gem.bin_path('rake') is not an executable file and line 26:
run cmd, results 
raise an error:
'C:/Ruby/lib/ruby/gems/1.8/gems/rake-0.8.4/bin/rake' is not recognized as an int
ernal or external command,
operable program or batch file.

(see also <a href='http://rubyforge.org/forum/forum.php?thread_id=32969&forum_id=2129'>this thread</a>
Including Gem.ruby in the command solves the problem:

bin_path = /mswin/ =~ RUBY_PLATFORM ? "#{Gem.ruby} #{Gem.bin_path('rake')}" : Gem.bin_path('rake')
cmd = ENV['rake'] || bin_path rescue Gem.default_exec_format % 'rake'

I didn't file a patch because I couldn't test this under linux and I wanted to avoid any regression bug

this is my environment

RubyGems Environment:
  - RUBYGEMS VERSION: 1.3.2
  - RUBY VERSION: 1.8.6 (2008-08-11 patchlevel 287) [i386-mswin32]
  - INSTALLATION DIRECTORY: c:/ruby/lib/ruby/gems/1.8
  - RUBY EXECUTABLE: c:/ruby/bin/ruby.exe
  - EXECUTABLE DIRECTORY: c:/ruby/bin
  - RUBYGEMS PLATFORMS:
    - ruby
    - x86-mswin32-60
  - GEM PATHS:
     - c:/ruby/lib/ruby/gems/1.8
     - C:/Documents and Settings/Administrator/.gem/ruby/1.8
  - GEM CONFIGURATION:
     - :update_sources => true
     - :verbose => true
     - :benchmark => false
     - :backtrace => false
     - :bulk_threshold => 1000
  - REMOTE SOURCES:
     - http://gems.rubyforge.org/


----------------------------------------------------------------------

>Comment By: James Tucker (raggi)
Date: 2009-05-01 09:26

Message:
Luis, good catch!

----------------------------------------------------------------------

Comment By: Luis Lavena (luislavena)
Date: 2009-04-30 17:59

Message:
James, take in consideration that "Gem.ruby" could be inside a PATH with spaces and it need to be handled properly.

The same applies to rake.

----------------------------------------------------------------------

Comment By: James Tucker (raggi)
Date: 2009-04-30 12:10

Message:
Fixed in r2180.

----------------------------------------------------------------------

Comment By: James Tucker (raggi)
Date: 2009-04-30 12:05

Message:
What is required for normal operation on most builds should be:

"#{Gem.ruby} -rubygems #{Gem.bin_path('rake')}"


----------------------------------------------------------------------

Comment By: Luis Lavena (luislavena)
Date: 2009-04-30 00:19

Message:
The problem I see is that RakeBuild should use Gem.ruby + Gem.bin_path('rake') and not rake directly.

----------------------------------------------------------------------

You can respond by visiting: 
http://rubyforge.org/tracker/?func=detail&atid=575&aid=25734&group_id=126


More information about the Rubygems-developers mailing list