Thanks for this hack! This helped me out quite a bit. For as long capistrano has been out there, I can't believe there are still so many issues with deploying from a Windows machine!!
I had to make this change with the backslashes and I had to correct the zip problem too (made a zip.bat and an unzip.bat file with the proper commands so it would pass the deploy:check tests). Finally it is could checkout my project and is now compressing all the files to transfer up to my production server. Thanks for your work! On Jan 13, 4:39 pm, Tilendor <tilen...@gmail.com> wrote: > Hey there. I am just getting started with using Capistrano for our > first Rails app ever. We are developing onWindowsboxes on a company > network. We are deploying to a Virtual Private Server running linux, > Fedora Core 7. We are also using Subversion. I don't want to poke > holes through our firewall to give access to svnserve(and I couldn't > figure out how). So its very necessary for us to use the :copy > option. I was running into a problem with a command that was > incorrectly switching slashes. > > The repository lives at svn://192.xxx.xxx.xxx:xxx/. When trying to > get a local copy of the repository, it would execute this command: svn > checkout -q --username xxxxx --password --no-auth-cache -r2005 svn:\ > \192.xxx.xxx.xxx:xxxx\ c:\Docume~1\tilendor\locals~1\temp > \20090113204628 > > The script blindly flip slashes on the URL the same as the filepath > and fail, because the svn URL wasn't valid. > > I made a patch which worked for me. > In capistrano\recipes\deploy\stategy\base.rd on line 50 is the method: > def system(*args) > cmd = args.join(' ') > if RUBY_PLATFORM =~ /win32/ > cmd.gsub!('/','\\') # Replace / with \\ > cmd.gsub!(/^cd /,'cd /D ') # Replace cd with cd /D > cmd.gsub!(/&& cd /,'&& cd /D ') # Replace cd with cd /D > logger.trace "executing locally: #{cmd}" > super(cmd) > else > logger.trace "executing locally: #{cmd}" > super > end > end > > The problem line is cmd.gsub!('/','\\') #replace / with \\ that > blindly alters the URL and the filepath. > > I made the following change: > > if RUBY_PLATFORM =~ /win32/ > parts = cmd.split(' ') > parts.collect! do |part| > part.gsub!('/','\\') unless /\/\// =~ part # if the > string has // is probably a url, don't change. > part > end > cmd = parts.join(' ') > cmd.gsub!(/^cd /,'cd /D ') # Replace cd with cd /D > cmd.gsub!(/&& cd /,'&& cd /D ') # Replace cd with cd /D > logger.trace "executing locally: #{cmd}" > super(cmd) > > I be there are otherwindowsusers that face this issue. What would > it take to get this included in a future version of Capistrano? > > Thanks, > ~Tilendor --~--~---------~--~----~------------~-------~--~----~ To unsubscribe from this group, send email to capistrano-unsubscr...@googlegroups.com For more options, visit this group at http://groups.google.com/group/capistrano -~----------~----~----~----~------~----~------~--~---