capistrano31 Jan 2016
miscellaneous notes about capistrano (general information, troubleshooting).
It’s just SSH
Everything in Capistrano comes down to running SSH commands on remote servers.
Capistrano depends on connecting to your server(s) with SSH using key-based (i.e. password-less) authentication.
Not for provisioning
Server provisioning steps are not done by Capistrano.
first run of
deploy:assets:precompile task exited with error
on the next run assets were precompiled without errors.
capistrano runs rake
db:migrate on first deploy instead of rake
one option is to comment out
require 'capistrano/rails/migrations' line in
RAILS_ENV=staging rake db:schema:load manually and uncomment
the line afterwards.
sidekiq:start task hangs, just hangs
problem was solved by removing command to source RVM script from Sidekiq init.d script.
fatal: Could not read from remote repository.
$ cap production deploy ... 00:05 git:check 01 git ls-remote firstname.lastname@example.org:C******d/sith.git HEAD 01 Warning: Permanently added the RSA host key for IP address '52.74.XXX.XXX' to the list of known hosts. 01 email@example.com: Permission denied (publickey). 01 fatal: Could not read from remote repository. 01 01 Please make sure you have the correct access rights 01 and the repository exists.
first make sure you forward agent in .ssh/config:
Host sith User sith Hostname <hostname> IdentityFile ~/.ssh/id_rsa ForwardAgent yes
then it’s necessary to restart SSH agent: either restart terminal if you’re
ssh-agent Zsh plugin or restart SSH agent manually:
$ ssh-add -D $ ssh-agent $ ssh-add