[Rake-devel] rake system() and windows

Dominic Sisneros dsisnero at gmail.com
Wed May 14 21:05:17 EDT 2008


What is the best way to invoke ruby system commands on a windows box?

desc "Install the merb-more sub-gems"
task :install_gems do
  gems.each do |dir|
    Dir.chdir(dir){ sh "rake install" }
  end
end

This fails because it actually needs rake.bat files

If I do the following, it works

rake_cmd = (PLATFORM == "i386-mswin32") ? "rake.bat" : "rake"
desc "Install the merb-more sub-gems"
task :install_gems do
  gems.each do |dir|
    Dir.chdir(dir){ sh "#{rake_cmd} install" }
  end
end

The problem with this is this needs to be done for every ruby/bin command
that you want to use
-------------- next part --------------
An HTML attachment was scrubbed...
URL: <http://rubyforge.org/pipermail/rake-devel/attachments/20080514/931f8db1/attachment.html>


More information about the Rake-devel mailing list