I'm trying to deploy the Beast forum using Capistrano, Radrails and SVN and it's proving to be a major headache.
The files themselves are looking good (ie changes, to fastcgi, shebang, .htaccess, env.rb). I've tested deploying the application manually by following the tutorial @ HostingRails, and it works great.
However, when using capistrano, I run "cap cold_deploy" and it always fails when it gets to the restart task, providing me with
* executing task restart
* executing "/home/iskandu/beastfash/current/script/process/reaper"
servers: ["iskandu.com"]
[iskandu.com] executing command
** [out :: iskandu.com] Couldn't find any pid file in '/home/iskandu/beastfash/
current/tmp/pids' matching
** [out :: iskandu.com] 'dispatch.[0-9]*.pid'
** [out :: iskandu.com] (also looked for processes matching "/home/iskandu/beas
tfash/current/public/dispa
** [out :: iskandu.com] tch.fcgi")
command finished "
Any idea how to fix this? When I travel over to my domain of iskandu.com, all I see is a generic "Application error
Rails application failed to start properly"
Initially I left the restart task as it was when I had the deploy.rb created for me, and this gave the sudo error that is in the thread "http://www.hostingrails.com/forums/deployment_troubleshooting_thread/48"
The strange thing is that it's still called reaper in the restart task, even though I'm specifying in the deploy.rb for it not too. Is this a special case that I'm unaware about?
Here's a copy of my deploy.rb
set :application, "beastfash"
set :repository, "svn+ssh://iskandu@iskandu.com/home/iskandu/svn/beastfash/trunk"
role :web, "iskandu.com"
role :app, "iskandu.com"
role :db, "iskandu.com", :primary => true
set :deploy_to, "/home/iskandu/beastfash" # defaults to "/u/apps/#{application}"
set :user, "iskandu" # defaults to the currently logged in user
set :use_sudo, false
set :checkout, "export"
set :restart_via, :run
desc <<DESC
An imaginary backup task. (Execute the 'show_tasks' task to display all
available tasks.)
DESC
task :backup, :roles => :db, :only => { :primary => true } do
on_rollback { delete "/tmp/dump.sql" }
run "mysqldump -u theuser -p thedatabase > /tmp/dump.sql" do |ch, stream, out|
ch.send_data "thepassword\n" if out =~ /^Enter password:/
end
end
desc "link in production database credentials"
task :after_update_code do
run <<-CMD
ln -nfs #{deploy_to}/#{shared_dir}/config/database.yml #{release_path}/config/database.yml
CMD
run "chmod +x #{release_path}/script/process/reaper"
run "chmod +x #{release_path}/script/process/spawner"
run "chmod a+x #{release_path}/public/dispatch.fcgi"
end
desc "A task demonstrating the use of transactions."
task :long_deploy do
transaction do
update_code
disable_web
symlink
migrate
end
desc "Restarting after deployment"
task :after_deploy, :roles => [:app, :db, :web] do
run "touch /home/iskandu/beastfash/current/public/dispatch.fcgi"
end
desc "Restarting after rollback"
task :after_rollback, :roles => [:app, :db, :web] do
run "touch /home/iskandu/beastfash/current/public/dispatch.fcgi"
end
task :restart, :roles => :app do
# do nothing but overide the default
end
end
I've symlinked the ~/beastfash/current/public to ~/public_html and that doesn't seem to help either.I've run script/console production from within the directory and that loads fine, and I'm able to play with my variables etc.
I'm certain that my htaccess, shebang, environment.rb is correct. Should these be different from the tutorial for Capistrano to work properly?
Thank you very much for any feedback/help!