# Rake remote\_exec on Windows

**URL:** <https://www.ruby-forum.com/t/rake-remote-exec-on-windows/50453>\
**Category:** Rails\
**Created:** [December 16, 2005, 2:57pm UTC](https://www.ruby-forum.com/t/rake-remote-exec-on-windows/50453 "2005-12-16T14:57:39Z")\
**Posts on this page:** 7\
**Page:** 1

<div class="post-metadata">

**Author:** ![krisleech](https://www.ruby-forum.com/letter_avatar_proxy/v4/letter/k/59ef9b/32.png) [@krisleech](https://www.ruby-forum.com/u/krisleech)\
**Post date:** [December 16, 2005, 2:57pm UTC](https://www.ruby-forum.com/t/rake-remote-exec-on-windows/50453/1 "2005-12-16T14:57:39Z")

</div>

I am using the shovel deploy.rb from [http://nubyonrails.com/pages/shovel](http://nubyonrails.com/pages/shovel)  
I have SwitchTower-ized my app, copied the shovel deploy.rb file and put  
my settings in it.

But when I run “rake remote\_exec ACTION=setup\_lighty” from the local app  
root it has no effect. It should prompt for a password for at least  
throw an error? I just get returned to the DOS prompt.

If I do “rake remote\_exec ACTION=random\_text” it does exactly the same  
so I’m thinking the issue is with remote\_exec and not my deploy.rb file?

Any suggestions…

Cheers K.

---

<div class="post-metadata">

**Author:** ![krisleech](https://www.ruby-forum.com/letter_avatar_proxy/v4/letter/k/59ef9b/32.png) [@krisleech](https://www.ruby-forum.com/u/krisleech)\
**Post date:** [December 16, 2005, 4:42pm UTC](https://www.ruby-forum.com/t/rake-remote-exec-on-windows/50453/2 "2005-12-16T16:42:12Z")

</div>

On 12/16/05, Kris L. [removed\_email\_address@domain.invalid](mailto:removed_email_address@domain.invalid) wrote:

> so I’m thinking the issue is with remote\_exec and not my deploy.rb file?  
> Posted via [http://www.ruby-forum.com/](http://www.ruby-forum.com/).
> 
> * * *
> 
> Rails mailing list  
> removed\_email\_address@domain.invalid  
> [http://lists.rubyonrails.org/mailman/listinfo/rails](http://lists.rubyonrails.org/mailman/listinfo/rails)

I thought switchtower was not useable in windows due to rpc and  
non-posix  
issues ?

–

---

<div class="post-metadata">

**Author:** ![krisleech](https://www.ruby-forum.com/letter_avatar_proxy/v4/letter/k/59ef9b/32.png) [@krisleech](https://www.ruby-forum.com/u/krisleech)\
**Post date:** [December 16, 2005, 5:00pm UTC](https://www.ruby-forum.com/t/rake-remote-exec-on-windows/50453/3 "2005-12-16T17:00:21Z")

</div>

On Dec 16, 2005, at 8:40 AM, Peter F. wrote:

> > 
> 
> ## –
> 
> ## Joyeux Noël
> 
> Peter F.

You can’t use switchtower to deploy TO a windows box, but it should  
work fine deploying FROM a windows box.

In the past, others have had this problem because Windows doesn’t  
understand that the switchtower executable is executable. Can the OP  
look to see where switchtower was installed? Possibly try running the  
following from the DOS prompt:

switchtower --help

If you get a “command not found” error, then it is likely that the  
switchtower executable is either not in your path, or the  
switchtower.cmd file is missing.

- Jamis\_\_\_\_\_\_\_\_\_\_\_\_\_\_\_\_\_\_\_\_\_\_\_\_\_\_\_\_\_\_\_\_\_\_\_\_\_\_\_\_\_\_\_\_\_\_\_  
Rails mailing list  
removed\_email\_address@domain.invalid  
[http://lists.rubyonrails.org/mailman/listinfo/rails](http://lists.rubyonrails.org/mailman/listinfo/rails)

---

<div class="post-metadata">

**Author:** ![krisleech](https://www.ruby-forum.com/letter_avatar_proxy/v4/letter/k/59ef9b/32.png) [@krisleech](https://www.ruby-forum.com/u/krisleech)\
**Post date:** [December 16, 2005, 6:43pm UTC](https://www.ruby-forum.com/t/rake-remote-exec-on-windows/50453/4 "2005-12-16T18:43:00Z")

</div>

On Dec 16, 2005, at 10:10 AM, Kris L. wrote:

> Thanks, I am deploying to Textdrive from Windows, so should be OK with  
> regards to posix.
> 
> Typing switchtower --help works… I get the help stuff.
> 
> I have used switchtower --apply-to . to get the orignal deploy.rb  
> anyway  
> so im guessing Windows knows where it is and will execute it.
> 
> Is remote\_exec part of SwitchTower?

No, remote\_exec is a rake task that invokes switchtower (you can see  
it in lib/tasks/switchtower.rake).

If that remote\_exec task isn’t working, but switchtower is, you can  
always use switchtower directly:

switchtower -vvvv -r config/deploy -a setup\_lighty

(-vvvv means “be very verbose”, -r gives the path to the recipe file,  
and -a is which action to invoke. You can give -a multiple times to  
invoke multiple actions.)

Regarding the remote\_exec rake task… If switchtower is in your path  
and is executable, then I’m not sure what’s going on–I haven’t used  
Windows in ages. ☹ Any switchtower-savvy Windows users around that  
can help troubleshoot this one?

- Jamis

---

<div class="post-metadata">

**Author:** ![krisleech](https://www.ruby-forum.com/letter_avatar_proxy/v4/letter/k/59ef9b/32.png) [@krisleech](https://www.ruby-forum.com/u/krisleech)\
**Post date:** [December 16, 2005, 6:10pm UTC](https://www.ruby-forum.com/t/rake-remote-exec-on-windows/50453/5 "2005-12-16T18:10:29Z")

</div>

Thanks, I am deploying to Textdrive from Windows, so should be OK with  
regards to posix.

Typing switchtower --help works… I get the help stuff.

I have used switchtower --apply-to . to get the orignal deploy.rb anyway  
so im guessing Windows knows where it is and will execute it.

Is remote\_exec part of SwitchTower?

Jamis B. wrote:

> You can’t use switchtower to deploy TO a windows box, but it should  
> work fine deploying FROM a windows box.

---

<div class="post-metadata">

**Author:** ![krisleech](https://www.ruby-forum.com/letter_avatar_proxy/v4/letter/k/59ef9b/32.png) [@krisleech](https://www.ruby-forum.com/u/krisleech)\
**Post date:** [December 16, 2005, 8:28pm UTC](https://www.ruby-forum.com/t/rake-remote-exec-on-windows/50453/6 "2005-12-16T20:28:37Z")

</div>

I am running switchtower from Windows to TextDrive with no problems.

I ran into this problem as well. In my case, I had to add the ‘.cmd’  
to the end of the switchtower commands in the  
lib/tasks/switchtower.rake file.

For instance, change:

system “switchtower -vvvv -r config/deploy #{actions}”

To:

system “switchtower.cmd -vvvv -r config/deploy #{actions}”

And although you didn’t ask, you will need to define your own restart  
task for TextDrive (this is for lighttpd).

First create a script on your host to restart lighttpd. In my case, I  
called it lighttpdctl and placed it in a scripts directory off my home  
directory of my TextDrive account. Here is the snippet I used for the  
script:

[http://textsnippets.com/posts/show/241](http://textsnippets.com/posts/show/241)

Then you will need to define a restart task in your config/deploy.rb.  
Here is mine:

desc “Restart the web server”  
task :restart, :roles =\> :app do  
run “/home/your\_account/scripts/lighttpdctl restart”  
end

Good Luck,  
Tom

---

<div class="post-metadata">

**Author:** ![krisleech](https://www.ruby-forum.com/letter_avatar_proxy/v4/letter/k/59ef9b/32.png) [@krisleech](https://www.ruby-forum.com/u/krisleech)\
**Post date:** [December 19, 2005, 11:02am UTC](https://www.ruby-forum.com/t/rake-remote-exec-on-windows/50453/7 "2005-12-19T11:02:04Z")

</div>

Thanks Tom, that worked a treat.

I just need to tweek the shovel delpoy.rb as I want each Rails app in a  
folder named after the Project not URL.

Shovel makes folders like /sites/domain.com/  
but I want /sites/AppName/

Tom D. wrote:

> And although you didn’t ask, you will need to define your own restart  
> task for TextDrive (this is for lighttpd).

It appears lighttpdctl is created for you.

Thanks again, K.
