views:

887

answers:

2

Hi

I am getting the following error when I do a cap deploy, which checks out of a git master repository:

Could anyone please help me?

Thanks in advance

/var/lib/gems/1.8/gems/capistrano-2.5.8/lib/capistrano/configuration/servers.rb:78:in `role_list_from': unknown role `app' (ArgumentError)
    from /var/lib/gems/1.8/gems/capistrano-2.5.8/lib/capistrano/configuration/servers.rb:75:in `map'
    from /var/lib/gems/1.8/gems/capistrano-2.5.8/lib/capistrano/configuration/servers.rb:75:in `role_list_from'
    from /var/lib/gems/1.8/gems/capistrano-2.5.8/lib/capistrano/configuration/servers.rb:47:in `find_servers'
    from /var/lib/gems/1.8/gems/capistrano-2.5.8/lib/capistrano/configuration/servers.rb:10:in `find_servers_for_task'
    from /var/lib/gems/1.8/gems/capistrano-2.5.8/lib/capistrano/configuration/connections.rb:133:in `execute_on_servers'
    from /var/lib/gems/1.8/gems/capistrano-2.5.8/lib/capistrano/configuration/actions/invocation.rb:170:in `run_tree'
    from /var/lib/gems/1.8/gems/capistrano-2.5.8/lib/capistrano/configuration/actions/invocation.rb:143:in `run'
    from /var/lib/gems/1.8/gems/capistrano-2.5.8/lib/capistrano/configuration/actions/invocation.rb:208:in `sudo'
    from /var/lib/gems/1.8/gems/capistrano-2.5.8/lib/capistrano/configuration/actions/invocation.rb:89:in `send'
    from /var/lib/gems/1.8/gems/capistrano-2.5.8/lib/capistrano/configuration/actions/invocation.rb:89:in `invoke_command'
    from /var/lib/gems/1.8/gems/capistrano-2.5.8/lib/capistrano/recipes/deploy.rb:123:in `try_sudo'
    from /var/lib/gems/1.8/gems/capistrano-2.5.8/lib/capistrano/recipes/deploy.rb:136:in `try_runner'
    from /var/lib/gems/1.8/gems/capistrano-2.5.8/lib/capistrano/configuration/namespaces.rb:186:in `send'
    from /var/lib/gems/1.8/gems/capistrano-2.5.8/lib/capistrano/configuration/namespaces.rb:186:in `method_missing'
    from /var/lib/gems/1.8/gems/capistrano-2.5.8/lib/capistrano/recipes/deploy.rb:302:in `load'
    from /var/lib/gems/1.8/gems/capistrano-2.5.8/lib/capistrano/configuration/execution.rb:139:in `instance_eval'
    from /var/lib/gems/1.8/gems/capistrano-2.5.8/lib/capistrano/configuration/execution.rb:139:in `invoke_task_directly_without_callbacks'
    from /var/lib/gems/1.8/gems/capistrano-2.5.8/lib/capistrano/configuration/callbacks.rb:27:in `invoke_task_directly'
    from /var/lib/gems/1.8/gems/capistrano-2.5.8/lib/capistrano/configuration/execution.rb:89:in `execute_task'
    from /var/lib/gems/1.8/gems/capistrano-2.5.8/lib/capistrano/configuration/namespaces.rb:186:in `send'
    from /var/lib/gems/1.8/gems/capistrano-2.5.8/lib/capistrano/configuration/namespaces.rb:186:in `method_missing'
    from /var/lib/gems/1.8/gems/capistrano-2.5.8/lib/capistrano/configuration/namespaces.rb:104:in `restart'
    from /var/lib/gems/1.8/gems/capistrano-2.5.8/lib/capistrano/recipes/deploy.rb:154:in `load'
    from /var/lib/gems/1.8/gems/capistrano-2.5.8/lib/capistrano/configuration/execution.rb:139:in `instance_eval'
    from /var/lib/gems/1.8/gems/capistrano-2.5.8/lib/capistrano/configuration/execution.rb:139:in `invoke_task_directly_without_callbacks'
    from /var/lib/gems/1.8/gems/capistrano-2.5.8/lib/capistrano/configuration/callbacks.rb:27:in `invoke_task_directly'
    from /var/lib/gems/1.8/gems/capistrano-2.5.8/lib/capistrano/configuration/execution.rb:89:in `execute_task'
    from /var/lib/gems/1.8/gems/capistrano-2.5.8/lib/capistrano/configuration/execution.rb:101:in `find_and_execute_task'
    from /var/lib/gems/1.8/gems/capistrano-2.5.8/lib/capistrano/cli/execute.rb:45:in `execute_requested_actions_without_help'
    from /var/lib/gems/1.8/gems/capistrano-2.5.8/lib/capistrano/cli/execute.rb:44:in `each'
    from /var/lib/gems/1.8/gems/capistrano-2.5.8/lib/capistrano/cli/execute.rb:44:in `execute_requested_actions_without_help'
    from /var/lib/gems/1.8/gems/capistrano-2.5.8/lib/capistrano/cli/help.rb:19:in `execute_requested_actions'
    from /var/lib/gems/1.8/gems/capistrano-2.5.8/lib/capistrano/cli/execute.rb:33:in `execute!'
    from /var/lib/gems/1.8/gems/capistrano-2.5.8/lib/capistrano/cli/execute.rb:14:in `execute'
    from /var/lib/gems/1.8/gems/capistrano-2.5.8/bin/cap:4
    from /usr/bin/cap:19:in `load'
    from /usr/bin/cap:19

Deploy.rb file contents:

set :deploy_to, "/home/edward/captest2"

set :application, "captest2"

role :web, "localhost"

default_run_options[:pty] = true

set :repository,  "[email protected]:/usr/home/git"

set :scm, "git"

set :scm_passphrase, Proc.new { Capistrano::CLI.password_prompt("GIT Password for #{scm_user}:") }  #This is your custom users password

set :user, "edward"

set :branch, "master"

ssh_options[:forward_agent] = true
+1  A: 

The roles should look like this:

set :application, "deditest1.example.net" set :domain, "deditest1.example.net"

role :app, application role :web, application role :db, application

A: 

You've set an "app" role, but no "db" or "web". If everything is on localhost, use this instead: server "localhost", :app, :web, :db, :primary => true

graywh