# Capistrano on Windows

**URL:** <https://www.ruby-forum.com/t/capistrano-on-windows/58251>\
**Category:** Rails\
**Created:** [April 20, 2006, 12:23am UTC](https://www.ruby-forum.com/t/capistrano-on-windows/58251 "2006-04-20T00:23:57Z")\
**Posts on this page:** 3\
**Page:** 1

<div class="post-metadata">

**Author:** ![casper\_the\_ghost](https://www.ruby-forum.com/letter_avatar_proxy/v4/letter/c/58956e/32.png) [@casper\_the\_ghost](https://www.ruby-forum.com/u/casper_the_ghost)\
**Post date:** [April 20, 2006, 12:23am UTC](https://www.ruby-forum.com/t/capistrano-on-windows/58251/1 "2006-04-20T00:23:57Z")

</div>

So, I’ve just completed my first develop-test-deploy-wait  
-fix-test-deploy,  
and although it was successful it was a nightmare to carry out.  
Aside from not knowing that sqlite doesnt have a facility to delete  
columns from tables, the whole operation reeked of “hacked,” with  
multiple command windows open while I sprinted back and forth  
between my dev machine and the web server (luckily the app is on  
an intranet so I have physical access to the systems).

Capistrano seems to be what I am looking for. However, not three  
paragraphs into the manual, I see:

“The remote server is capable of understanding POSIX shell  
commands. (Windows, by default, does not fall  
into this category)…”

This is highly discouraging, so much so that I skipped my normal  
procedure of doing a Google search for “[Cool Script/Program that  
doesnt work under Windows] under Windows.” I’m just tired of  
having to jump through hoops to acheive what it takes Unix users  
2 seconds to do. From not ever getting “rake freeze\_gems” to work,  
to the absolute debacle that is rails+IIS/fastcgi/lighttpd/ISAPI (you’re  
telling me with a straight face that I need to install Apache to get  
rails working in IIS? WTF?) I’m extremely frustrated.

I’m whining. Back to my original question. I want to implement  
Capistrano on my Windows-based setup. Am I wasting my time  
insofar as huge chunks of functionality will be unavailable or will I be  
able to utilize  
it in some sort of useful capacity?

Thank you.

---

<div class="post-metadata">

**Author:** ![casper\_the\_ghost](https://www.ruby-forum.com/letter_avatar_proxy/v4/letter/c/58956e/32.png) [@casper\_the\_ghost](https://www.ruby-forum.com/u/casper_the_ghost)\
**Post date:** [April 20, 2006, 1:28am UTC](https://www.ruby-forum.com/t/capistrano-on-windows/58251/2 "2006-04-20T01:28:33Z")

</div>

A couple of quick things. I also have the mis-fortune of deploying on  
Windows, but I AM lucky enough to be able to use Apache, but that’s  
besides  
the point.  
First, I’m assuming you are already using Subversion, or at least  
CVS…right? Because these are your best friends when it comes to  
updating  
your apps.  
Your second best friend…migrations! =) These little guys are great  
and  
safe a load of time. I’m not sure how SQLite handles these, I use  
postgres,  
but I would think they are implemented for sqlite as well.

So, with these to things in mind here’s my usual update process: (all  
from a  
terminal server so no sprinting involved:) )  
Start -\> Run -\> Cmd  
`cd [to rails app]`  
`svn update`  
May or may not put up a maintenance message depending on the update and  
if  
my migrations would break anything. The good thing about this is that  
your  
models/controllers wont change until you restart the server, so that  
saves  
the ‘hurry up before someone reloads a page’ type deal, most of the  
time.  
`rake migrate`  
Do a graceful restart on Apache so it doesn’t interrupt any current  
users.  
And I’m done.

This misses a couple things that capistrino would do for you, which  
again  
are a limitation of windows. First is the sym linking of directories for  
different versions and for your common files like logs. Second, you  
obviously would have to do this on all your servers by hand if you have  
some  
kind of cluster/load balancing scheme.

This process though hasn’t really failed me yet, and lets me do small,  
incremental updates really quickly. It means I’m committing a lot more  
to  
SVN, but thats not a bad thing is it? 🙂

I know I’m a little OT here, but I think trying to re-implement Cap on  
windows would be a big pain in the arse, and would require more things  
installed, and have a better likely hood of having something in the  
chain  
breaking. I like to keep it as simple as possible. That being said, if I  
had  
a choice of running on a 'nix box, I would most definitely use  
Capistrino.

-Nick

---

<div class="post-metadata">

**Author:** ![casper\_the\_ghost](https://www.ruby-forum.com/letter_avatar_proxy/v4/letter/c/58956e/32.png) [@casper\_the\_ghost](https://www.ruby-forum.com/u/casper_the_ghost)\
**Post date:** [April 20, 2006, 4:55am UTC](https://www.ruby-forum.com/t/capistrano-on-windows/58251/3 "2006-04-20T04:55:37Z")

</div>

Capistrano should work on Win32 systems, at least if you have Cygwin  
installed and are using Cygwin’s sshd, svn client and so on, since all  
it really does is log in via ssh and run a bunch of basic Unix-style  
commands remotely. You may need to spend a lot of time compared to most  
of us writing/customizing your Capistrano recipes and getting the Cygwin  
environment vars set properly and maybe figuring out how to best restart  
Apache from the commandline if you’re using services, but it seems as  
though it should work.

Someone on the wiki mentioned it worked but that it definitely needs the  
cygwin svn client and reworked recipes.

Lester Bangs wrote:

> So, I’ve just completed my first develop-test-deploy-wait  
> -fix-test-deploy,  
> and although it was successful it was a nightmare to carry out.  
> Aside from not knowing that sqlite doesnt have a facility to delete  
> columns from tables, the whole operation reeked of “hacked,” with  
> multiple command windows open while I sprinted back and forth  
> between my dev machine and the web server (luckily the app is on  
> an intranet so I have physical access to the systems).
> 
> Capistrano seems to be what I am looking for. However, not three  
> paragraphs into the manual, I see:
> 
> “The remote server is capable of understanding POSIX shell  
> commands. (Windows, by default, does not fall  
> into this category)…”
> 
> This is highly discouraging, so much so that I skipped my normal  
> procedure of doing a Google search for “[Cool Script/Program that  
> doesnt work under Windows] under Windows.” I’m just tired of  
> having to jump through hoops to acheive what it takes Unix users  
> 2 seconds to do. From not ever getting “rake freeze\_gems” to work,  
> to the absolute debacle that is rails+IIS/fastcgi/lighttpd/ISAPI (you’re  
> telling me with a straight face that I need to install Apache to get  
> rails working in IIS? WTF?) I’m extremely frustrated.
> 
> I’m whining. Back to my original question. I want to implement  
> Capistrano on my Windows-based setup. Am I wasting my time  
> insofar as huge chunks of functionality will be unavailable or will I be  
> able to utilize  
> it in some sort of useful capacity?
> 
> Thank you.
