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

noreply at rubyforge.org noreply at rubyforge.org
Wed Apr 29 20:05:30 EDT 2009


Bugs item #25734, was opened at 2009-04-30 02: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: None
Priority: 3
Submitted By: Paolo Angelini (pablito)
Assigned to: Nobody (None)
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/


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

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