[Rubygems-developers] [ rubygems-Bugs-26458 ] gem bin scripts are broken if there are spaces in GEM_HOME ENV variable on Windows

noreply at rubyforge.org noreply at rubyforge.org
Sun Jul 5 13:27:31 EDT 2009


Bugs item #26458, was opened at 2009-06-29 20:15
You can respond by visiting: 
http://rubyforge.org/tracker/?func=detail&atid=575&aid=26458&group_id=126

Category: `gem install` command
Group: v1.3.x
>Status: Closed
>Resolution: Accepted
Priority: 3
Submitted By: Eric Hodel (drbrain)
Assigned to: Luis Lavena (luislavena)
Summary: gem bin scripts are broken if there are spaces in GEM_HOME ENV variable on Windows

Initial Comment:
If you try to run a bin script created by rubygems, ruby is unable to
load the file inside the gem's bin dir.  This is because Gem.bin_path
wraps paths with spaces in quotes.  This was added for #25734.
Gem.bin_path was modified to work on the Windows command line, but is
broken when used with Kernel#load

C:\scripts\repo\rubygems>pik list
C:/Documents and Settings/gthiesfeld/.gem/ruby/1.8/bin/pik:19:in
`load': no such file to load -- "C:/documents and
settings/gthiesfeld/.gem/ruby/1.8/gems/pik-0.0.2/bin/pik" (LoadError)
       from C:/Documents and Settings/gthiesfeld/.gem/ruby/1.8/bin/pik:19

C:\scripts\repo\rubygems>cat "c:\Documents and
Settings\gthiesfeld\.gem\ruby\1.8\bin\pik" | grep -n load
19:load Gem.bin_path('pik', 'pik', version)

C:\scripts\repo\rubygems>svn blame lib\rubygems.rb | grep -n -A 2 -B 2 2183
384-  2064    drbrain     end
385-  2064    drbrain
386:  2183      raggi     File.join(spec.full_gem_path, spec.bindir,
exec_name).sub(/.*\s.*/m, '"\&"')
387-  2064    drbrain   end
388-  2064    drbrain

C:\scripts\repo\rubygems>svn log | grep -A 4 2183
r2183 | raggi | 2009-05-01 04:56:11 -0500 (Fri, 01 May 2009) | 2 lines

Gem.bin_path now escapes paths with spaces. Thanks to Luis Lavena in #25734.


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

>Comment By: Luis Lavena (luislavena)
Date: 2009-07-05 14:27

Message:
Fix applied in revision 2272.

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

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


More information about the Rubygems-developers mailing list