Skip to content

Instantly share code, notes, and snippets.

@DevanB
Created January 6, 2014 16:09
Show Gist options
  • Star 0 You must be signed in to star a gist
  • Fork 0 You must be signed in to fork a gist
  • Save DevanB/8285053 to your computer and use it in GitHub Desktop.
Save DevanB/8285053 to your computer and use it in GitHub Desktop.
Deploy.rb and error trace for Capistrano 3
set :application, 'liveinbham'
set :deploy_user, 'deployer'
set :use_sudo, false
set :ssh_options, { :forward_agent => true }
#set repo details
set :scm, :git
set :repo_url, 'git@github.com:DevanB/LIveInBham.git'
set :scm_verbose, true
set :git_shallow_clone, 1
set :git_enable_submodules, 1
#set rbenv
set :rbenv_type, :system
set :rbenv_ruby, '2.0.0-p353'
set :rbenv_path, '/home/deployer/.rbenv'
set :rbenv_prefix, "RBENV_ROOT=#{fetch(:rbenv_path)} RBENV_VERSION=#{fetch(:rbenv_ruby)} #{fetch(:rbenv_path)}/bin/rbenv exec"
set :rbenv_map_bins, %w{rake gem bundle ruby rails}
set :rbenv_roles, :all
# how many old releases do we want to keep
set :keep_releases, 5
# files we want symlinking to specific entires in shared.
set :linked_files, %w{config/database.yml config/application.yml}
# dirs we want symlinking to shared
set :linked_dirs, %w{bin log tmp/pids tmp/cache tmp/sockets vendor/bundle public/system public/uploads}
# what specs should be run before deployment is allowed to continue, see lib/capistrano/tasks/run_tests.cap
# set :tests, ["spec"]
# which config files should be copied by deploy:setup_config
# see documentation in lib/capistrano/tasks/setup_config.cap for details of operations
set(:config_files, %w(
nginx.conf
application.yml
database.example.yml
log_rotation
unicorn.rb
unicorn_init.sh
))
# which config files should be made executable after copying by deploy:setup_config
set(:executable_config_files, %w(
unicorn_init.sh
))
# files which need to be symlinked to other parts of the filesystem. For example
# nginx virtualhosts, log rotation, inits scripts, etc.
set(:symlinks, [
{
source: "nginx.conf",
link: "/etc/nginx/sites-enabled/#{fetch(:full_app_name)}"
},
{
source: "unicorn_init.sh",
link: "/etc/init.d/unicorn_#{fetch(:full_app_name)}"
},
{
source: "log_rotation",
link: "/etc/logrotate.d/#{fetch(:full_app_name)}"
}
])
# this:
# http://www.capistranorb.com/documentation/getting-started/flow/
# is worth reading for a quick overview of what tasks are called
# and when for `cap stage deploy`
namespace :deploy do
# make sure we're deploying what we think we're deploying
before :deploy, "deploy:check_revision"
# only allow a deploy with passing tests to deployed
before :deploy, "deploy:run_tests"
# compile assets locally then rsync
after 'deploy:symlink:shared', 'deploy:compile_assets_locally'
after :finishing, 'deploy:cleanup'
end
# ask :branch, proc { `git rev-parse --abbrev-ref HEAD`.chomp }
# set :format, :pretty
# set :log_level, :debug
# set :default_env, { path: "/opt/ruby/bin:$PATH" }
➜ liveinbham git:(master) ✗ cap production deploy:setup_config --trace
** Invoke production (first_time)
** Execute production
** Invoke load:defaults (first_time)
** Execute load:defaults
[deprecated] I18n.enforce_available_locales will default to true in the future. If you really want to skip validation of your locale you can set I18n.enforce_available_locales = false to avoid this message.
** Invoke rbenv:validate (first_time)
** Execute rbenv:validate
DEBUG [3aaa26ce] Running /usr/bin/env [ ! -d /home/deployer/.rbenv/versions/2.0.0-p353 ] on 192.241.246.120
DEBUG [3aaa26ce] Command: [ ! -d /home/deployer/.rbenv/versions/2.0.0-p353 ]
cap aborted!
deployer
/Users/devanb/.rbenv/versions/2.0.0-p247/lib/ruby/gems/2.0.0/gems/net-ssh-2.7.0/lib/net/ssh.rb:215:in `start'
/Users/devanb/.rbenv/versions/2.0.0-p247/lib/ruby/gems/2.0.0/gems/sshkit-1.2.0/lib/sshkit/backends/netssh.rb:169:in `ssh'
/Users/devanb/.rbenv/versions/2.0.0-p247/lib/ruby/gems/2.0.0/gems/sshkit-1.2.0/lib/sshkit/backends/netssh.rb:122:in `block in _execute'
/Users/devanb/.rbenv/versions/2.0.0-p247/lib/ruby/gems/2.0.0/gems/sshkit-1.2.0/lib/sshkit/backends/netssh.rb:119:in `tap'
/Users/devanb/.rbenv/versions/2.0.0-p247/lib/ruby/gems/2.0.0/gems/sshkit-1.2.0/lib/sshkit/backends/netssh.rb:119:in `_execute'
/Users/devanb/.rbenv/versions/2.0.0-p247/lib/ruby/gems/2.0.0/gems/sshkit-1.2.0/lib/sshkit/backends/netssh.rb:62:in `test'
/Users/devanb/.rbenv/versions/2.0.0-p247/lib/ruby/gems/2.0.0/gems/capistrano-rbenv-2.0.0/lib/capistrano/tasks/rbenv.rake:10:in `block (3 levels) in <top (required)>'
/Users/devanb/.rbenv/versions/2.0.0-p247/lib/ruby/gems/2.0.0/gems/sshkit-1.2.0/lib/sshkit/backends/netssh.rb:54:in `instance_exec'
/Users/devanb/.rbenv/versions/2.0.0-p247/lib/ruby/gems/2.0.0/gems/sshkit-1.2.0/lib/sshkit/backends/netssh.rb:54:in `run'
/Users/devanb/.rbenv/versions/2.0.0-p247/lib/ruby/gems/2.0.0/gems/sshkit-1.2.0/lib/sshkit/runners/parallel.rb:12:in `block (2 levels) in execute'
Tasks: TOP => rbenv:validate
@PelagicDev
Copy link

I'm having this same issue...were you able to find a way to resolve this issue?

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment