# config/deploy.rb
require "bundler/capistrano"

require 'debot'

server "<%=@server%>", :domain, :web, :app, :db, primary: true

set :user, "<%=@user%>"
set :group, "<%=@group%>"
set :use_sudo, false
set :keep_releases, <%=@number_of_releases%> # keep only the last 7 releases

set :application, "<%=@application%>"
set :stages, %w(<%=@stage_names.join(" ")%>)
set :default_stage, "<%=@stage_names.first%>"

# This needs to be after the stages variable declaration
require "capistrano/ext/multistage"

set :default_shell, "bash -l" # set the cap shell to be same as user's SSH environment

default_run_options[:pty] = true
ssh_options[:forward_agent] = true

set :scm, :<%=@scm%>
set :scm_verbose, true
set :repository, "<%=@repository%>"
set :migrate_target, :current
set :rails_env, "production"
set :environment, "production"
set :normalize_asset_timestamps, false
set :deploy_via, :remote_cache

set :app_parent_directory, "<%=@app_parent_directory %>" 

#ssh_options[:verbose] = :debug # don't remove it's very important and meant for debugging capistrano

after "deploy", "deploy:cleanup"

# config/deploy.rb
require "bundler/capistrano"

require 'debot'

server "<%=@server%>", :domain, :web, :app, :db, primary: true

set :user, "<%=@user%>"
set :group, "<%=@group%>"
set :use_sudo, false
set :keep_releases, <%=@number_of_releases%> # keep only the last 7 releases

set :application, "<%=@application_name%>"
set :stages, %w(<%=@stage_names.join(" ")%>)
set :default_stage, "<%=@stage_names.first%>"

# This needs to be after the stages variable declaration
require "capistrano/ext/multistage"

set :default_shell, "bash -l" # set the cap shell to be same as user's SSH environment

default_run_options[:pty] = true
ssh_options[:forward_agent] = true

set :scm, :<%=@scm%>
set :scm_verbose, true
set :repository, "<%=@repository%>"
set :migrate_target, :current
set :rails_env, "production"
set :environment, "production"
set :normalize_asset_timestamps, false
set :deploy_via, :remote_cache

set :app_parent_directory, "<%=@app_parent_directory %>" 

#ssh_options[:verbose] = :debug # don't remove it's very important and meant for debugging capistrano

after "deploy", "deploy:cleanup"

Change variable name from application to application_name
Change variable name from application to application_name