Topic: spin command not found

I am trying to get rails to deploy to OS X server running apache and
mongrel, and I think I'm almost there finally.
After running 'cap cold_deploy' I get to the point where it tries to
run the spin command, which fails.

The error message is:

[out :: mydomain.com] sudo: /Library/WebServer/Documents/apps/appname/
current/script/spin: command not found

Then the cold deploy process fails.

The strange part is that the spin file actually does exist at the
specified location on the remote server. Has anyone run into this
before?

I've also posted this to the capistrano google group.

Re: spin command not found

I'm wondering if the permissions on that file are set incorrectly? Is it an executable file?

Railscasts - Free Ruby on Rails Screencasts

Re: spin command not found

I set the permissions to -rwxrwx--x but I am still seeing the same problem. This problem is really getting to me, I've rechecked the path dozens of times thinking I must be missing some very obvious, but still no luck.

Also, I cannot run the spin command manually either, it says command not found

Re: spin command not found

Check the shebang (#!) line at the top of the spin file. Can you tell if it's correct?

Railscasts - Free Ruby on Rails Screencasts

Re: spin command not found

 #!/usr/bin/env ruby

/Library/WebServer/Documents/apps/bento/current/script/process/spawner


This is all I have in my spin file, how can I check if my shebang line is correct? I just copied it over from the other script files.

Thanks again for the help ryan

Re: spin command not found

Oh, looks like it's just a normal shell script, not a ruby script. So remove that shebang line or set it to this:

#!/bin/sh

This should call the spawner command - perhaps this is the part that is actually raising that error. Does the process/spawner command exist? Do the same troubleshooting on that command.

Railscasts - Free Ruby on Rails Screencasts

Re: spin command not found

I've changed the file as you've specified, and now textmate is highlighting the syntax correctly at least, but the same error message comes up.

My spawner looks like this, and when I run it locally it works

#!/usr/bin/env ruby
require File.dirname(__FILE__) + '/../../config/boot'
require 'commands/process/spawner'

I think I must be missing something obvious here, I am going to try looking over the documentation again to see what i've done wrong.

Re: spin command not found

The spin file references the command by the full path

/Library/WebServer/Documents/apps/bento/current/script/process/spawner

Try using that full path to call the spawner. Perhaps a folder was renamed somewhere up the path?

Railscasts - Free Ruby on Rails Screencasts

Re: spin command not found

That is exactly the same line I have in my file, I have even tried cutting and pasting.

What is strange is that if I type

sudo ./spin

#or

sudo process/spawner


It says command not found, although both files are clearly there (they even tab complete) and they both have execution permissions(771).

Last edited by dahuk (2007-05-21 17:39:33)

Re: spin command not found

I'm stumped. The error may actually be happening inside the spawner script, but I dont' know enough about it. Perhaps someone else has some ideas?

Railscasts - Free Ruby on Rails Screencasts

Re: spin command not found

Okay I think I've solved part of it (after 8 hours now). The cap cold_deploy resets the permissions on the spawner and reaper scripts whenever it is run, I think spin too actually. Also the version of rails specified in my environment.rb didn't match what was on the server (1.2.1 and 1.2.3) so that prevented spawner from running as well.

If I manually change the permissions, and then manually run the script without actually calling 'cap cold_deploy' on the dev box, it will spawn the mongrel cluster.

Now I just have to figure out how to prevent it from resetting the permissions.

Thanks for talking me through this!

Re: spin command not found

maybe just try cap deploy instead of cold_deploy.

Railscasts - Free Ruby on Rails Screencasts

Re: spin command not found

That will giving me errors saying the reaper command is not found smile

Again in this case it is overwriting the executable bit.

Re: spin command not found

Okay, I figured it out finally, I have to set the files as executable in the svn repository, as specified here:

http://groups.google.com/group/capistra … 3b39d57161

Thanks!

Last edited by dahuk (2007-05-22 05:58:06)

Re: spin command not found

I have managed to get pretty much everything working. I ended up having to specify the location of my rake tool so the migration would work by adding

set :rake, "/usr/local/bin/rake"

i am still getting an error with the spinner though
 Neither FCGI (spawn-fcgi) nor Mongrel was installed and available!

If I run the spin command directly on the server though, mongrel boots up fine, or I can just start it with the mongrel_rails cluster::start command. It would be nice of cold_deploy worked though, does anyone have any ideas?

At least once I manually start mongrel 'cap deploy' works fine (I think).

After I get this done I am going to make an attempt to write a tutorial for deploying to OS X Server, it has been a painful way to do things.

*edit*

Actually, I take that back, things work fine if I use spin, but not if I use 'mongrel_rails cluster::start'.
If I use the mongrel_rails command mongrel starts up but does not respond.

Last edited by dahuk (2007-05-22 12:36:29)