I’m having problems launching the spin process via the deploy.rb task.
Everything works great when is run the script manually via:
% ssh [email protected] /Web/Rails/Example/current/script/spin
However, when I run ‘cap spinner’ or ‘rake remote:exec ACTION=spinner’,
I get the following errors:
% cap spinner
loading configuration
/opt/local/lib/ruby/gems/1.8/gems/capistrano-1.1.0/lib/capistrano/recipes/standard.rb
loading configuration ./config/deploy.rb
- executing task spinner
- executing “/Web/Rails/Example/current/script/spin”
servers: [“monterey.example.net”]
Password:
[monterey.example.net] executing command
** [out :: monterey.example.net]
/Web/Rails/Example/current/script/process/…/…/config/boot.rb:6:in
require' ** [out :: monterey.example.net] : ** [out :: monterey.example.net] No such file to load -- pathname ** [out :: monterey.example.net] ( ** [out :: monterey.example.net] LoadError ** [out :: monterey.example.net] ) ** [out :: monterey.example.net] from /Web/Rails/Example/current/script/process/../../config/boot.rb:6 ** [out :: monterey.example.net] from /Web/Rails/Example/current/script/process/spinner:2:in
require’
** [out :: monterey.example.net] from
/Web/Rails/Example/current/script/process/spinner:2
command finished
/opt/local/lib/ruby/gems/1.8/gems/capistrano-1.1.0/lib/capistrano/command.rb:45:in
process!': command "/Web/Rails/Example/current/script/spin" failed on monterey.example.net (RuntimeError) from /opt/local/lib/ruby/gems/1.8/gems/capistrano-1.1.0/lib/capistrano/actor.rb:176:in
run’
from
/opt/local/lib/ruby/gems/1.8/gems/capistrano-1.1.0/lib/capistrano/actor.rb:425:in
execute_on_servers' from /opt/local/lib/ruby/gems/1.8/gems/capistrano-1.1.0/lib/capistrano/actor.rb:173:in
run’
from ./config/deploy.rb:106:inload' from /opt/local/lib/ruby/gems/1.8/gems/capistrano-1.1.0/lib/capistrano/actor.rb:125:in
spinner’
from
/opt/local/lib/ruby/gems/1.8/gems/capistrano-1.1.0/lib/capistrano/cli.rb:246:in
execute_recipes!' from /opt/local/lib/ruby/gems/1.8/gems/capistrano-1.1.0/lib/capistrano/cli.rb:246:in
execute_recipes!’
from
/opt/local/lib/ruby/gems/1.8/gems/capistrano-1.1.0/lib/capistrano/cli.rb:221:in
execute!' from /opt/local/lib/ruby/gems/1.8/gems/capistrano-1.1.0/lib/capistrano/cli.rb:12:in
execute!’
from
/opt/local/lib/ruby/gems/1.8/gems/capistrano-1.1.0/bin/cap:11
from /opt/local/bin/cap:18
Why would the require ‘pathname’ fail for cap and not ssh? It is my
understanding that the deployment tasks are all handled by ssh…
For completeness, here is my spin script:
#!/bin/bash
/Web/Rails/Example/current/script/process/spinner
-c ‘/Web/Rails/Example/current/script/process/spawner -p 7000 -i 5’
-d
And the deploy.rb task:
desc “Start the spinner daemon”
task :spinner, :roles => :app do
run “#{current_path}/script/spin”
end
Pretty much the same as the Capistrano docs.
Any help or suggestions would be greatly appreciated.
-ch