Oleander Oleander - 3 months ago 13
Ruby Question

Deploy using Capistrano - is only run for servers matching

Im trying to deploy my application using Capistrano, but I get this error message:


`deploy:setup' is only run for servers matching {:except=>{:no_release=>true}}, but no servers matched


When running this command:

bundle exec cap deploy:setup


Here is my deploy.rb file.

set :application, "example.com"
set :repository, "git@github.com:username/repo.git"
set :use_sudo, false
set :scm, :git
set :web, application
set :app, application
set :db, application
set :branch, "master"
set :user, "webmaster"
set :deploy_to, "/opt/www/#{application}"
set :deploy_via, :remote_cache
set :domain, application
set :port, 2222

set :bundler_cmd, "bundle install --deployment --without=development,test"
ssh_options[:paranoid] = false

namespace :deploy do
task :start do ; end
task :stop do ; end

task :restart_stalker do
run "cd #{deploy_to}/current && thor stalker:kill && stalker:init"
end

task :restart, :roles => :app, :except => { :no_release => true } do
run "cd #{deploy_to}/current && touch tmp/restart.txt"
end

after "bundler_cmd", "deploy:restart_stalker"
end


I'm using Rails 3.

Answer

You need to define some roles. E.g.:

role :app, 'myapphostname'
role :web, 'mywebhostname'

It seems you used "set" instead of "role", but you should confirm this before making the change.

Comments