Switchtower, Windows & Setup


#1

I’m developing on WinXP and deploying to SuSe Linux. Both machines have
been upgraded to Rails 0.14.3 and have the switchtower gem installed.

The only modifications I made to the deploy.rb file on my development
machine is the following lines:

========================
set :application, “intranet”
set :repository, “svn://hcc-intranet1/#{application}/trunk”

role :web, “hcc-intranet1”
role :app, “hcc-intranet1”
role :db, “hcc-intranet1”

set :deploy_to, “/srv/www/apps/#{application}”

I pull up a cmd prompt, navigate to RAILS_ROOT, and entered the
following: “rake remote_exec ACTION=setup”

the output is as follows:

(in C:/railsapp)

and then I just get a C:\ prompt again. No prompt for a password, no
error messages, no nothing. It takes all of 5 seconds. I go to my
remote server and no folders have been created.

I have absolutely no idea what’s going wrong here. Anyone have any
idea what is or how I can get more verbose output to try to track down
the problem myself?

Thanks in advance.
==================DISCLAIMER================================
This email may contain confidential and privileged material for the sole
use of the intended recipient.
Any review or distribution by others is strictly prohibited. If you are
not the intended recipient, please contact the sender and delete all
copies of it from your system.
The sender accepts no responsibility for viruses and it is your
responsibility to scan attachments (if any).
No contracts may be concluded on behalf of the sender by means of email
communications unless expressly stated to the contrary.
==================DISCLAIMER================================


#2

What version of the Net::SSH gem do you have installed? There was a
problem with 1.0.2 that caused problems on windows. Please try
upgrading your Net::SSH gem to the latest (1.0.3) and let me know if
that makes any difference.

  • Jamis

#3

jamis wrote:

What version of the Net::SSH gem do you have installed? There was a
problem with 1.0.2 that caused problems on windows. Please try
upgrading your Net::SSH gem to the latest (1.0.3) and let me know if
that makes any difference.

  • Jamis

Hm. I’ve got the same thing going on right now. I am using net-ssh
1.0.3 and switchtower 0.9.0.

I’m stuck.


#4

On Dec 22, 2005, at 10:18 AM, Jake J. wrote:

I’m stuck.

What was the problem again? I don’t remember the previous part of
this thread.

  • Jamis

#5

Jake J. wrote:

Jamis B. wrote:

On Dec 22, 2005, at 10:18 AM, Jake J. wrote:

I’m stuck.

What was the problem again? I don’t remember the previous part of
this thread.

  • Jamis

Sorry – I get used to the forum style. When you do “rake remote_exec
ACTION=setup”, nothing happens.

Hmm…I sent a reply but it didn’t seem to go through for some reason.
Lets try it again…

Did you set the svn:executable and svn:eol-style properties on your
dispatch.fcgi file and all the files in your script folder? If you’re
deploying from Windows to Linux, subversion (on the Windows machine) has
to know that these files are supposed to be executable and that their
end-of-line characters need to be changed for the *nix environment.

If you need help doing this, let me know.


#6

Jamis B. wrote:

On Dec 22, 2005, at 10:18 AM, Jake J. wrote:

I’m stuck.

What was the problem again? I don’t remember the previous part of
this thread.

  • Jamis

Sorry – I get used to the forum style. When you do “rake remote_exec
ACTION=setup”, nothing happens.


#7

Marc L. wrote:

Jake J. wrote:

Jamis B. wrote:

On Dec 22, 2005, at 10:18 AM, Jake J. wrote:

I’m stuck.

What was the problem again? I don’t remember the previous part of
this thread.

  • Jamis

Sorry – I get used to the forum style. When you do “rake remote_exec
ACTION=setup”, nothing happens.

Hmm…I sent a reply but it didn’t seem to go through for some reason.
Lets try it again…

Did you set the svn:executable and svn:eol-style properties on your
dispatch.fcgi file and all the files in your script folder? If you’re
deploying from Windows to Linux, subversion (on the Windows machine) has
to know that these files are supposed to be executable and that their
end-of-line characters need to be changed for the *nix environment.

If you need help doing this, let me know.

Opps sorry, I see that you did get my first email. I did a search
through my email archive and found the email that Jamis sent to me that
solved the problem.

At your command prompt enter:

switchtower -vvvv -r config/deploy -a setup

This is the command that the rakefile attempts to execute. For some
reason it seems that the command “switchtower” will work from the
command line, but will not work when its executed from a script file.

I think also that if you edit switchtower.rake so that the line that
reads like above reads like this instead:

switchtower.cmd -vvvv -r config/deploy -a setup

that it then works fine from the rake command. But don’t take my word
for that cause I haven’t tested it.


#8

Opps sorry, I see that you did get my first email. I did a search
through my email archive and found the email that Jamis sent to me that
solved the problem.

At your command prompt enter:

switchtower -vvvv -r config/deploy -a setup

Ok… So this worked, but when I went back to “rake deploy” I had the
same problem. So I started looking around. Other people seem to be
perfectly happy with rake/switchtower/Windows. I haven’t seen another
reference to this issue so far. I can’t possibly be the only one using
Switchtower from a Windows-hosted development environment.

Am I missing something else?

Jake


#9

switchtower.cmd -vvvv -r config/deploy -a setup

that it then works fine from the rake command. But don’t take my word
for that cause I haven’t tested it.

Nice. That worked fine!


#10

Jake J. wrote:

Opps sorry, I see that you did get my first email. I did a search
through my email archive and found the email that Jamis sent to me that
solved the problem.

At your command prompt enter:

switchtower -vvvv -r config/deploy -a setup

Ok… So this worked, but when I went back to “rake deploy” I had the
same problem. So I started looking around. Other people seem to be
perfectly happy with rake/switchtower/Windows. I haven’t seen another
reference to this issue so far. I can’t possibly be the only one using
Switchtower from a Windows-hosted development environment.

Am I missing something else?

Jake

Sorry, I’m just reminding myself of how I did this. You definetly need
to edit your switchtower.rake file located in .\lib\tasks\

Change all the:

system “switchtower -vvvv …”

commands to:

system “switchtower.cmd -vvvv …”

This fixes all the possible switchtower commands to work with Windows.

I’m going to edit the Rails Wiki to note all the changes that need to be
made for people developing on Windows. Maybe Jamis will add it to the
book or maybe we can get a patch created that will modify the
switchtower.rake template depending on what kind of system its being
installed on.


#11

Jamis B. wrote:

For the record, the next version of SwitchTower will (hopefully) fix
this once and for all–I’m following the advice of a few other users
and am having the rake tasks call directly into the ST code, rather
than invoking the switchtower utility via the command-line.

With a bit of luck, the next version will be available early next week.

  • Jamis

Sweet! Thanks alot Jamis for the work you’ve done to bring us
Switchtower! Its been an absolute lifesaver ever since I got it up and
running.


#12

For the record, the next version of SwitchTower will (hopefully) fix
this once and for all–I’m following the advice of a few other users
and am having the rake tasks call directly into the ST code, rather
than invoking the switchtower utility via the command-line.

With a bit of luck, the next version will be available early next week.

  • Jamis