Forum: Ruby on Rails rake remote_exec on Windows

Announcement (2017-05-07): www.ruby-forum.com is now read-only since I unfortunately do not have the time to support and maintain the forum any more. Please see rubyonrails.org/community and ruby-lang.org/en/community for other Rails- und Ruby-related community platforms.
3d333b0012928f3dd5a6861cb09ad683?d=identicon&s=25 Kris Leech (krisleech)
on 2005-12-16 14:57
I am using the shovel deploy.rb from 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.
3203ed0e608d3bfae1e31282e629ffa2?d=identicon&s=25 Peter Fitzgibbons (Guest)
on 2005-12-16 16:42
(Received via mailing list)
On 12/16/05, Kris Leech <krisleech@interkonect.com> wrote:
> so I'm thinking the issue is with remote_exec and not my deploy.rb file?
> Posted via http://www.ruby-forum.com/.
> _______________________________________________
> Rails mailing list
> Rails@lists.rubyonrails.org
> http://lists.rubyonrails.org/mailman/listinfo/rails
>

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

--
992fe8c19bbbc27f2b562a9f96efc03d?d=identicon&s=25 Jamis Buck (Guest)
on 2005-12-16 17:00
(Received via mailing list)
On Dec 16, 2005, at 8:40 AM, Peter Fitzgibbons wrote:

>>
> --
> ------------------------------
> Joyeux Noël
> ------------------------------
> Peter Fitzgibbons

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
Rails@lists.rubyonrails.org
http://lists.rubyonrails.org/mailman/listinfo/rails
3d333b0012928f3dd5a6861cb09ad683?d=identicon&s=25 Kris Leech (krisleech)
on 2005-12-16 18:10
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 Buck wrote:

> You can't use switchtower to deploy TO a windows box, but it should
> work fine deploying FROM a windows box.
992fe8c19bbbc27f2b562a9f96efc03d?d=identicon&s=25 Jamis Buck (Guest)
on 2005-12-16 18:43
(Received via mailing list)
On Dec 16, 2005, at 10:10 AM, Kris Leech 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
22580f640e491f0920a192610d1df393?d=identicon&s=25 Tom Davies (Guest)
on 2005-12-16 20:28
(Received via mailing list)
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

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
3d333b0012928f3dd5a6861cb09ad683?d=identicon&s=25 Kris Leech (krisleech)
on 2005-12-19 11:02
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 Davies 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.
This topic is locked and can not be replied to.