Patches: Browse | Submit New | Admin
rake_builder.rb, line 29, builds a rake command to execute to install a gem: cmd += " RUBYARCHDIR=#{dest_path} RUBYLIBDIR=#{dest_path}" # ENV is frozen The problem is that this breaks with paths that have spaces. For example: gem install -i C:\Program Files ruby-prof Creates this rake command: rake RUBYARCHDIR=C:/Program Files/gems/ruby-prof-0.7.1-x86-mswin32-60/lib RUBYLIBDIR=C:/Program Files/gems/ruby-prof-0.7.1-x86-mswin32-60/lib Which executes as this: rake RUBYARCHDIR=Files/gems/ruby-prof-0.7.1-x86-mswin32-60/lib RUBYLIBDIR=Files/gems/ruby-prof-0.7.1-x86-mswin32-60/lib And thus fails. To fix, the cmd line needs to enclose paths in quotes, like this: cmd += " RUBYARCHDIR=\"#{dest_path}\" RUBYLIBDIR=\"#{dest_path}\"" # ENV is frozen Thanks - Charlie
Add A Comment:
Date: 2009-01-02 19:03 Sender: Charlie Savage Hi Dan, Sounds good - thanks. Charlie
Date: 2009-01-02 12:55 Sender: Daniel Berger Ok, I've split the difference. The dest_path is now quoted if it contains spaces. Fixed in trunk. Thanks for the clarification and the report. Regards, Dan
Date: 2009-01-02 10:27 Sender: Darren Schreiber I stumbled upon this when I was NOT using the -i flag. It happens when someone installs Ruby and Rails in C:\Program Files\Ruby . Most people are probably not running into this because, on Windows, the default install is to C:\Ruby But it is definitely an issue that occurs with spaces in the path. The suggested fix works and does not appear to break anything else.
Date: 2009-01-02 09:08 Sender: Charlie Savage Hi Dan, The problem is that doing a default 'gem install' fails if you have a space in the path. My example using 'gem install -i' was simply showing the issue. It seems unreasonable to force users to specify the -i argument just because they have a space in their path. Charlie
Date: 2008-12-31 05:05 Sender: Daniel Berger Upon further review, this is an issue with the way you specified your arguments on the command line, i.e. you never quoted the path. It should be gem install -i "C:\Program Files" ruby-prof. Regards, Dan
Date: 2008-12-29 04:02 Sender: Darren Schreiber This fix worked for me.
Date: 2008-12-25 09:36 Sender: Daniel Berger Looks good to me. I vote to apply. Dan