Issue: You have an app using jsbundling-rails and esbuild. After deploy, the assets built by esbuild are missing in...

...you say... before 'deploy:update_code', 'db:dump' after 'deploy:symlink', 'craken:install' # Capistrano 2.9.0 after 'deploy:create_symlink', 'craken:install' # Capistrano 2.12.0 after 'deploy:restart', 'db:show_dump...

In newer passenger versions the output of passenger -v has changed. capistrano-passenger tries to parse the version and now causes the error undefined method '[]' for nil:NilClass. To fix...

...this you only need to upgrade the capistrano-passenger gem. Therefore run bundle update capistrano-passenger --conservative. The version change of passenger from 6.0.7 to 6.0.8 has triggered this problem...

SSHKit 1.9.0 might fail with the following error, when trying to deploy a Rail application. Upgrading the gem to version...

web.archive.org

Capistrano 2 brings the shell command which allows you to run commands on your deployment targets. There is also invoke to run a command directly from your terminal.

...allow running Capistrano tasks or shell commands, and scope to individual machines or machine roles. Unfortunately Capistrano 3 does not include these commands any more. cap shell Basics

After updating your RubyGems, you will probably not be able to run Capistrano any more, but receive an error similar to this: can't activate net-ssh (= 2.0.22) for [], already...

...other sensible place), that only contains these 2 lines: source 'http://rubygems.org' gem 'capistrano' gem 'capistrano-ext' # You need this for multistage deployments gem 'hoptoad_notifier' # Add this for projects...

You are getting when connecting via SSH or deploying with Capistrano (which uses SSH): Too many authentication failures for username This is caused by having too many SSH keys added...

...involves you keeping many keys will cause you pain. Painful fix for SSH and Capistrano: Add keys manually You will need to disable your gnome keyring daemon to regain control...

...deploy:after_deploy_tasks' # Keep this last Deploy with bundle exec. Now, when deploying, Capistrano will first check if there are any pending before deploy tasks. If so, it will...

When deploying code with Capistrano (depending on your configuration) at some point Capistrano tries to check out code from your repository. In order to do so, Capistrano connects to your...

Capistrano has the concept of a "rollback" that comes in really handy in case of errors. When you notice that your recent deploy was faulty, run cap deploy:rollback and...

...re back with the previous release. In case of an error during a deployment, Capistrano will rollback itself. But, you may ask, how can it know how to revert all...

...not found. This happens inside the deploy:assets:backup_manifest task. This task comes from capistrano-rails. It is build for Sprockets and does not work with Webpacker out of...

Solution Configure capistrano-rails to work with Webpacker Alternative If you are using capistrano-rails, but don't want to configure it for Webpacker, you can as well...

# do crazy stuff end end Whenever we call foo.bar in our recipe, Capistrano will fail if you deploy to a stage where none of the servers has the...

...a roles[:something] into your deploy.rb to avoid the above error message.\ Now, when Capistrano enters a hook and tries to call a method that is only available for that...

In Capistrano 2, directories in shared_children used to be symlinked to the shared directory during the finalize_update task. # /lib/capistrano/recipes/deploy.rb _cset :shared_children, %w(public/system log tmp/pids) # ... task :finalize...

...symlinks only the last segment here end # ... end This would symlink current/public/system to shared/system. Capistrano 3 (which is almost a complete rewrite of the project) now properly expands paths to...

...requests should be stored in public/system. Execute assets:precompile only on one server with Capistrano 3 If the assets directory is linked to glusterfs asset:precompile should only be executed...

...role web. You can overwrite this in deploy.rb: set :assets_roles, [:assets] This tells Capistrano that only the role :assets should precompile assets. Now you need to add the :assets...

Capistrano automatically logs each (successful) deployment into a file on your application servers. It is located at the root of your server's project folder, i.e. the parent of releases...

...currently deployed revision, we also have a card on this. It also contains a Capistrano task that can be called from developer machines...

...way to do this: the HOSTFILTER env variable. Commenting out "server" lines in the Capistrano deploy config will raise a Capistrano::NoMatchingServersError with is only run for servers matching {:roles...

...matched. Instead, specify the server-under-test like this: HOSTFILTER=separate-sidekiq.makandra.de cap production deploy Capistrano is aware of this env variable and will only deploy that single server, skipping any...

Attached is a working config to deploy an application with Capistrano that needs to monitor Resque workers with God. God will run as the deployment user, no need to register...

When you have a hook in your Capistrano file that dumps your remote database, you might not want it to dump each time you deploy (say, you're experimenting with...

...staging and don't want ten dumps an hour). How to skip dump creation: Capistrano 2 In your Capistrano file: before 'deploy:update_code', 'db:dump' unless fetch(:skip_dump...

Sometimes, through some firewall or proxy misconfiguration, you might have to deploy to a server that cannot access the git...

makandra dev

Capistrano recently had some API changes that can results in deploys not working when running with old deploy.rb files. So let's bundle it. Put capistrano into your Gemfile, like...

# Gemfile group :deploy do gem 'capistrano' gem 'capistrano_colors' end It's possible you need to do a bundle update net-ssh to get things running. Now double check...

You can seriously speed up deployments with Capistrano when using a local git repository on the server you are deploying to. Simply add set :deploy_via, :remote_cache

...exclude, [ '.git' ] to your config/deploy.rb and Capistrano will create a clone in shared/cached-copy. This will be updated using git pull when deploying which transfers less bytes and is usually much...

By default, Capistrano truncates server responses and places an ellipsis at the end of lines that are longer than your terminal. Error messages are never truncated. While this can be...

...knowing what is going on, even if causes a few extra lines of output. Capistrano by default uses Airbrussh which is where truncation happens. To disable truncation globally, place this...

Whenever you deploy using Capistrano, a new folder is created within the releases directory on the remote server containing the application code. By default Capistrano 3 keeps the last...

...connect to the server in order to e.g. access the production console. Guessing the Capistrano deploy user and then again guessing the right directory on the server is awkward, so...

...handy command shell-for. Run it from any project directory like this, passing a Capistrano multistage deployment target: shell-for staging Now it also supports commands to be remotely executed...